From 385bcac43d546d688da6ad9b8c67bf38cce73f46 Mon Sep 17 00:00:00 2001 From: chetannn Date: Sat, 25 May 2024 07:48:39 +0545 Subject: [PATCH] fix: validate website on company form --- src/components/onboarding/company-form.tsx | 2 +- src/trpc/routers/onboarding-router/schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/onboarding/company-form.tsx b/src/components/onboarding/company-form.tsx index 28939bf1a..a1ebf62d9 100644 --- a/src/components/onboarding/company-form.tsx +++ b/src/components/onboarding/company-form.tsx @@ -78,7 +78,7 @@ export const CompanyForm = ({ type, data }: CompanyFormProps) => { incorporationState: data?.company.incorporationState ?? "", incorporationType: data?.company.incorporationType ?? "", name: data?.company.name ?? "", - website: data?.company.website ?? "", + website: data?.company.website ?? null, state: data?.company.state ?? "", streetAddress: data?.company.streetAddress ?? "", zipcode: data?.company.zipcode ?? "", diff --git a/src/trpc/routers/onboarding-router/schema.ts b/src/trpc/routers/onboarding-router/schema.ts index 5198c6d6d..c5cc95a13 100644 --- a/src/trpc/routers/onboarding-router/schema.ts +++ b/src/trpc/routers/onboarding-router/schema.ts @@ -22,7 +22,7 @@ export const ZodCompanyMutationSchema = z.object({ name: z.string().min(1, { message: "Company name is required", }), - website: z.string().min(1).optional(), + website: z.string().url().nullable(), incorporationType: z.string().min(1, { message: "Incorporation type is required", }),