From ab4deaa0688d500167e3b44602e46da36e4f2abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Franquesa=20Mon=C3=A9s?= Date: Sat, 16 Mar 2024 20:36:34 +0100 Subject: [PATCH] BREW UNINSTALL HARDCODED --- src/app/[slug]/submit/page.tsx | 3 ++- src/app/submit/page.tsx | 9 ++++++++- src/components/Form.tsx | 5 +++-- src/config.ts | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/[slug]/submit/page.tsx b/src/app/[slug]/submit/page.tsx index eea0260..03d297b 100644 --- a/src/app/[slug]/submit/page.tsx +++ b/src/app/[slug]/submit/page.tsx @@ -2,6 +2,7 @@ import { ProfileForm } from "@/components/Form" import { db } from "@/lib/db" import { getAuthSession } from "@/lib/auth" import { notFound } from "next/navigation" +import { GCED_START } from "@/config" interface PageProps { params: { @@ -34,10 +35,10 @@ const page = async ({ params }: PageProps) => { ) diff --git a/src/app/submit/page.tsx b/src/app/submit/page.tsx index 4100ad5..b3b0893 100644 --- a/src/app/submit/page.tsx +++ b/src/app/submit/page.tsx @@ -1,12 +1,19 @@ import { getAuthSession } from "@/lib/auth" import { ProfileForm } from "@/components/Form" import { notFound } from "next/navigation" +import { GCED_START } from "@/config" const page = async ({}) => { const session = await getAuthSession() const isAdmin = session?.user?.isAdmin if (isAdmin === undefined) return notFound() - return + return ( + + ) } export default page diff --git a/src/components/Form.tsx b/src/components/Form.tsx index 064b78c..298c911 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -22,6 +22,7 @@ import { Combobox } from "@/components/Combobox" import { Checkbox } from "@/components/ui/checkbox" import { ApuntsPostCreationRequest } from "@/lib/validators/post" import { uploadFiles } from "@/lib/uploadthing" +import { GCED_START } from "@/config" const formSchema = z.object({ pdf: z.any(), @@ -46,13 +47,13 @@ const formSchema = z.object({ export function ProfileForm({ PreselectedSubject, isAdmin, + generacio, semester, - generacio = 2017, }: { PreselectedSubject: string isAdmin: boolean + generacio: number semester?: number - generacio?: number }) { const router = useRouter() diff --git a/src/config.ts b/src/config.ts index 53cbb5a..cd179dc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1 +1,2 @@ export const INFINITE_SCROLL_PAGINATION_RESULTS = 4 +export const GCED_START = 2017