refactor: improve groups LiveView based on code review feedback
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3eb4cde0b7
commit
ddc8335cc0
8 changed files with 109 additions and 104 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue