fix(feeds): make sure posts for feeds are ordered by publication date desc

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-12-20 09:26:28 +01:00
parent e73fd9b370
commit 3c75856149
2 changed files with 14 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ defmodule Mobilizon.Service.Export.Common do
@spec fetch_instance_public_content(integer()) :: {:ok, list(Event.t()), list(Post.t())}
def fetch_instance_public_content(limit) do
%Page{elements: events} = Events.list_public_local_events(1, limit, :begins_on, :desc)
%Page{elements: posts} = Posts.list_public_local_posts(1, limit)
%Page{elements: posts} = Posts.list_public_local_posts(1, limit, :publish_at, :desc)
{:ok, events, posts}
end