order channels by visibility

This commit is contained in:
inhji 2023-03-31 13:41:50 +02:00
parent 50d196d0b9
commit d3f585f807

View file

@ -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)