fixes
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { GetUser } from "@/actions/auth";
|
||||
import { fetchUser } from "@/actions/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import MeComponent from "./component";
|
||||
import { getConsents } from "@/actions/consents";
|
||||
import { fetchConsents } from "@/actions/consents";
|
||||
import { fetchAllPositions, fetchAllPermissions } from "@/actions/positions";
|
||||
|
||||
export default async function Me() {
|
||||
const user = await GetUser();
|
||||
const user = await fetchUser();
|
||||
|
||||
if (!user) {
|
||||
redirect("/api/auth/initiate");
|
||||
}
|
||||
|
||||
const consents = await getConsents();
|
||||
const consents = await fetchConsents();
|
||||
const permissions = user.is_admin ? await fetchAllPermissions() : null;
|
||||
const positions = user.is_admin ? await fetchAllPositions() : null;
|
||||
|
||||
return <MeComponent userData={user} consentsData={consents} />;
|
||||
return <MeComponent userData={user} consentsData={consents} permissionsData={permissions} positionsData={positions} />;
|
||||
}
|
||||
Reference in New Issue
Block a user