Locations added
This commit is contained in:
21
frontend/app/(auth)/dashboard/locations/page.tsx
Normal file
21
frontend/app/(auth)/dashboard/locations/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
"use server";
|
||||
import getMe from "@/lib/getMe";
|
||||
import hasPermissions from "@/lib/hasPermissions";
|
||||
import { redirect } from "next/navigation";
|
||||
import LocationsPage from "./_locations";
|
||||
|
||||
export default async function Page() {
|
||||
const me = await getMe();
|
||||
if (
|
||||
!me ||
|
||||
me.status === "Error" ||
|
||||
!me.data ||
|
||||
!hasPermissions(me.data.roles, {
|
||||
locations: ["get"],
|
||||
} as const).all
|
||||
) {
|
||||
redirect("/dashboard");
|
||||
}
|
||||
|
||||
return <LocationsPage user={me.data} />;
|
||||
}
|
||||
Reference in New Issue
Block a user