From 70366d8d7f5a36c9dc0dfcafa088fa33dfabac5b Mon Sep 17 00:00:00 2001 From: inhji Date: Mon, 27 Mar 2023 09:17:22 +0200 Subject: [PATCH] order channel notes by published_at date --- lib/chiya/channels.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/chiya/channels.ex b/lib/chiya/channels.ex index 63259eb..e8d5a09 100644 --- a/lib/chiya/channels.ex +++ b/lib/chiya/channels.ex @@ -9,7 +9,9 @@ defmodule Chiya.Channels do alias Chiya.Notes.Note @preloads [:notes] - @public_preloads [notes: (from n in Note, where: not is_nil(n.published_at))] + @public_preloads [notes: (from n in Note, + where: not is_nil(n.published_at), + order_by: [desc: n.published_at])] @doc """ Returns the list of channels.