From 6a69edf57e398ce9e80fdf75d852ebd02543c53d Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Sat, 12 Oct 2024 18:56:08 +0700 Subject: [PATCH] Refactor Apply page component to simplify pitchDeckSchema validation --- src/app/business/apply/page.tsx | 46 ++++----------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index fe87374..750d81d 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -28,16 +28,10 @@ import { DualOptionSelector } from "@/components/dualSelector"; import { MultipleOptionSelector } from "@/components/multipleSelector"; export default function Apply() { - const pitchDeckSchema = z - .union([ - z.string().url("Pitch deck must be a valid URL."), - z.instanceof(File).refine((file) => file.size > 0, { - message: "A file must be selected.", - }), - ]) - .refine((value) => typeof value === "string" || value instanceof File, { - message: "Pitch deck must be either a file or a URL.", - }); + const pitchDeckSchema = z.union([ + z.string().url("Pitch deck must be a valid URL."), + z.object({}), + ]); const formSchema = z.object({ companyName: z.string().min(5, { @@ -155,6 +149,7 @@ export default function Apply() { } else { console.log("URL Provided:", data.pitchDeck); } + console.table(transformedData); alert(JSON.stringify(transformedData)); }; const handleBusinessPitchChange = (type: string) => { @@ -281,12 +276,6 @@ export default function Apply() { {errors.industry.message as string}

)} - {/* */} - {/* {selectedIndustry} */} {/* How much money has your company raised to date? */}
- {businessPitch} )} - {/* What's the rough size of your community? */} - {/*
- -
- - -
-
*/} -