Skip to content

Commit

Permalink
Renommage clef de tri
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitfred committed Dec 20, 2024
1 parent 3d22b5c commit 85e1163
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/transport/lib/transport_web/views/dataset_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 85e1163

Please sign in to comment.