From d3f585f80702aa16483540225cd2720d7c0cca03 Mon Sep 17 00:00:00 2001 From: inhji Date: Fri, 31 Mar 2023 13:41:50 +0200 Subject: [PATCH] order channels by visibility --- 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 e8d5a09..6205e43 100644 --- a/lib/chiya/channels.ex +++ b/lib/chiya/channels.ex @@ -23,7 +23,9 @@ defmodule Chiya.Channels do """ def list_channels do - Repo.all(Channel) + Channel + |> order_by(desc: :visibility) + |> Repo.all() end def preload_channel(channel), do: Repo.preload(channel, @preloads)