Sort yield list by date descending
This commit is contained in:
@@ -21,6 +21,10 @@ defmodule Osuuspuutarha.Harvest do
|
||||
Repo.all(Yield)
|
||||
end
|
||||
|
||||
def get_sorted_by_date do
|
||||
Repo.all(Yield |> order_by({:desc, :date}))
|
||||
end
|
||||
|
||||
@doc """
|
||||
Gets a single yield.
|
||||
|
||||
|
||||
@@ -41,6 +41,6 @@ defmodule OsuuspuutarhaWeb.YieldLive.Index do
|
||||
end
|
||||
|
||||
defp list_yields do
|
||||
Harvest.list_yields()
|
||||
Harvest.get_sorted_by_date()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user