From b6fdf713e0fa33a0a1e159a68cdca5408126ad34 Mon Sep 17 00:00:00 2001 From: Sam Piper Date: Wed, 20 Nov 2024 12:58:06 +0000 Subject: [PATCH] fix: users/$id renders rep roles correctly --- apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx b/apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx index f725209..7f26e7c 100644 --- a/apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx +++ b/apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx @@ -1,7 +1,6 @@ import { UserAvatar } from "@/components/avatar"; import { LocationIcon } from "@/components/icons/Locations"; import Title from "@/components/title"; -import { useUserRoles } from "@/hooks/useUserRoles.ts"; import SignInChart from "@/routes/_authenticated/_reponly/sign-in/dashboard/-components/SignInChart.tsx"; import { getUser } from "@/services/users/getUser.ts"; import getUserSignIns from "@/services/users/getUserSignIns.ts"; @@ -15,7 +14,7 @@ import { Check, X } from "lucide-react"; export default function Component() { const data = Route.useLoaderData(); const { user, trainings, signIns } = data!; - const rep = useUserRoles().includes("Rep"); + const rep = user!.roles.some((role) => role.name === "Rep"); const locationIcon = (training: Training) => { return training.locations.map((location) => ); };