Skip to content

Commit

Permalink
fix: users/$id renders rep roles correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampiiiii committed Nov 20, 2024
1 parent 9f229cb commit b6fdf71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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) => <LocationIcon location={location} key={training.id} />);
};
Expand Down

0 comments on commit b6fdf71

Please sign in to comment.