diff --git a/lib/philomena_web/controllers/staff_controller.ex b/lib/philomena_web/controllers/staff_controller.ex index be351136..00ec61bc 100644 --- a/lib/philomena_web/controllers/staff_controller.ex +++ b/lib/philomena_web/controllers/staff_controller.ex @@ -12,12 +12,12 @@ defmodule PhilomenaWeb.StaffController do |> order_by(asc: :name) |> Repo.all() - categories = %{ - "Administrators" => Enum.filter(users, & &1.role == "admin"), - "Technical Team" => Enum.filter(users, & &1.role != "admin" and &1.secondary_role not in [nil, ""]), - "Moderators" => Enum.filter(users, & &1.role != "admin" and &1.secondary_role in [nil, ""]), - "Assistants" => Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""]) - } + categories = [ + "Administrators": Enum.filter(users, & &1.role == "admin"), + "Technical Team": Enum.filter(users, & &1.role != "admin" and &1.secondary_role not in [nil, ""]), + "Moderators": Enum.filter(users, & &1.role == "moderator" and &1.secondary_role in [nil, ""]), + "Assistants": Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""]) + ] render(conn, "index.html", categories: categories) end