order admin notes

This commit is contained in:
Inhji 2023-03-30 22:54:03 +02:00
parent 23b9d9957b
commit d97be57871

View file

@ -20,7 +20,10 @@ defmodule Chiya.Notes do
""" """
def list_notes do def list_notes do
Repo.all(Note) |> Repo.preload(@preloads) Note
|> order_by([n], [desc: n.updated_at, desc: n.published_at])
|> Repo.all()
|> Repo.preload(@preloads)
end end
@doc """ @doc """