mirror of
https://github.com/34892002/edgeKey.git
synced 2026-09-26 19:11:38 +08:00
18 lines
448 B
TypeScript
18 lines
448 B
TypeScript
import type { PrismaClient } from "../../../generated/prisma/client";
|
|
import { getSiteSetting } from "../../../modules/site/service";
|
|
|
|
export type Data = ReturnType<typeof data>;
|
|
|
|
export async function data(pageContext: {
|
|
prisma: PrismaClient;
|
|
session?: { user?: { role?: string } };
|
|
}) {
|
|
if (pageContext.session?.user?.role !== "admin") {
|
|
return { site: null };
|
|
}
|
|
|
|
return {
|
|
site: await getSiteSetting(pageContext.prisma),
|
|
};
|
|
}
|