From 48999695c9dadc145f639a61f0592f7566372ec0 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Tue, 24 Feb 2026 16:45:14 +0000 Subject: [PATCH] fix: uncomment code MONKA --- src/app/submit/page.tsx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/submit/page.tsx b/src/app/submit/page.tsx index faceed8..f2c63dd 100644 --- a/src/app/submit/page.tsx +++ b/src/app/submit/page.tsx @@ -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

An error occurred!

; - // } + try { + const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/admin/can-submit`); + value = await response.json(); + } catch (error) { + return

An error occurred!

; + } if (!value) return (