refactor: improve groups LiveView based on code review feedback
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-01-28 10:33:27 +01:00
parent 3eb4cde0b7
commit ddc8335cc0
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
8 changed files with 109 additions and 104 deletions

View file

@ -116,14 +116,17 @@ defmodule MvWeb.GroupLive.Index do
query =
Mv.Membership.Group
|> Ash.Query.load(:member_count)
|> Ash.Query.sort(:name)
opts = ash_actor_opts(actor)
case Ash.read(query, opts) do
{:ok, groups} ->
Enum.sort_by(groups, & &1.name)
groups
{:error, _} ->
{:error, _error} ->
require Logger
Logger.warning("Failed to load groups in GroupLive.Index")
[]
end
end