From 54d8dd0e611e92b31372be2187598beb80d08a06 Mon Sep 17 00:00:00 2001 From: mrevanzak Date: Wed, 22 May 2024 13:04:18 +0700 Subject: [PATCH] refactor: role enum on user schema --- apps/web/src/app/(app)/layout.tsx | 4 ++-- apps/web/src/components/footer.tsx | 2 +- apps/web/src/components/navbar.tsx | 2 +- apps/web/src/components/sidebar/sidebar-button.tsx | 2 +- apps/web/src/server/db/schema.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/(app)/layout.tsx b/apps/web/src/app/(app)/layout.tsx index d579f0b..22cb368 100644 --- a/apps/web/src/app/(app)/layout.tsx +++ b/apps/web/src/app/(app)/layout.tsx @@ -9,7 +9,7 @@ export default async function AuthLayout(props: { admin: React.ReactNode; }) { const session = await auth(); - const isAdmin = session?.user.role === "ADMIN"; + const isAdmin = session?.user.role === "admin"; const isMaintenance = await get("maintenance"); @@ -20,7 +20,7 @@ export default async function AuthLayout(props: { return (
- {session?.user.role === "ADMIN" && } + {session?.user.role === "admin" && }
diff --git a/apps/web/src/components/footer.tsx b/apps/web/src/components/footer.tsx index 6a48499..da82f6c 100644 --- a/apps/web/src/components/footer.tsx +++ b/apps/web/src/components/footer.tsx @@ -12,7 +12,7 @@ export function Footer() { const { resolvedTheme } = useTheme(); const { collapsed } = useSidebarContext(); const { data: session } = useSession(); - const isAdmin = session?.user.role === "ADMIN"; + const isAdmin = session?.user.role === "admin"; return (