mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-28 11:13:16 +00:00
fix: uncomment code
MONKA
This commit is contained in:
parent
a6c2d924f1
commit
48999695c9
1 changed files with 16 additions and 16 deletions
|
|
@ -19,26 +19,26 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default async function SubmitPage() {
|
||||
// const session = await auth();
|
||||
const session = await auth();
|
||||
|
||||
// if (!session) redirect("/login");
|
||||
// if (!session.user.username) redirect("/create-username");
|
||||
// const activePunishment = await prisma.punishment.findFirst({
|
||||
// where: {
|
||||
// userId: Number(session?.user.id),
|
||||
// returned: false,
|
||||
// },
|
||||
// });
|
||||
// if (activePunishment) redirect("/off-the-island");
|
||||
if (!session) redirect("/login");
|
||||
if (!session.user.username) redirect("/create-username");
|
||||
const activePunishment = await prisma.punishment.findFirst({
|
||||
where: {
|
||||
userId: Number(session?.user.id),
|
||||
returned: false,
|
||||
},
|
||||
});
|
||||
if (activePunishment) redirect("/off-the-island");
|
||||
|
||||
// Check if submissions are disabled
|
||||
let value: boolean | null = true;
|
||||
// try {
|
||||
// const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/admin/can-submit`);
|
||||
// value = await response.json();
|
||||
// } catch (error) {
|
||||
// return <p>An error occurred!</p>;
|
||||
// }
|
||||
try {
|
||||
const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/admin/can-submit`);
|
||||
value = await response.json();
|
||||
} catch (error) {
|
||||
return <p>An error occurred!</p>;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue