From 6e6d08f09877e5ab57c1f807ce4e488ab60573c4 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Fri, 29 Nov 2019 17:04:59 -0500 Subject: [PATCH] select users correctly --- lib/philomena_web/controllers/staff_controller.ex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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