From 85e1163911cb5ebbb1c5ec9ce9369935efe21428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Menou?= Date: Fri, 20 Dec 2024 17:34:02 +0100 Subject: [PATCH] Renommage clef de tri --- apps/transport/lib/transport_web/views/dataset_view.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/transport/lib/transport_web/views/dataset_view.ex b/apps/transport/lib/transport_web/views/dataset_view.ex index 832cfbb6b1..54919eee7f 100644 --- a/apps/transport/lib/transport_web/views/dataset_view.ex +++ b/apps/transport/lib/transport_web/views/dataset_view.ex @@ -420,7 +420,7 @@ defmodule TransportWeb.DatasetView do resources |> Enum.filter(fn r -> r.format == "csv" end) |> Enum.reject(fn r -> Resource.community_resource?(r) or Resource.documentation?(r) end) - |> Enum.max_by(&{&1.type, &1.last_update}, TransportWeb.DatasetView.CarpoolingSortKey, fn -> nil end) + |> Enum.max_by(&{&1.type, &1.last_update}, TransportWeb.DatasetView.ResourceTypeSortKey, fn -> nil end) end def get_resource_to_display(%Dataset{type: type, resources: resources}) @@ -580,7 +580,7 @@ defmodule TransportWeb.DatasetView do end end -defmodule TransportWeb.DatasetView.CarpoolingSortKey do +defmodule TransportWeb.DatasetView.ResourceTypeSortKey do def compare({left_type, left_last_update}, {right_type, right_last_update}) do cond do left_type == right_type -> DateTime.compare(left_last_update, right_last_update)