Update parent company validation to allow optional fields and handle null values in company details submission.
This commit is contained in:
@@ -2,8 +2,8 @@ import { z } from "zod";
|
||||
|
||||
export const parentCompanySchema = z.object({
|
||||
companyName: z.string()
|
||||
.min(1, "Parent company name is required")
|
||||
.max(100, "Parent company name cannot exceed 100 characters"),
|
||||
.max(100, "Parent company name cannot exceed 100 characters")
|
||||
.optional(),
|
||||
|
||||
address1: z.string()
|
||||
.max(150, "Address1 cannot exceed 150 characters")
|
||||
@@ -44,7 +44,7 @@ export const parentCompanySchema = z.object({
|
||||
}),
|
||||
|
||||
companyTypeXid: z.number()
|
||||
.min(1, "Company type XID is required"),
|
||||
.optional(),
|
||||
|
||||
websiteUrl: z.string().nullable().optional(),
|
||||
instagramUrl: z.string().nullable().optional(),
|
||||
|
||||
Reference in New Issue
Block a user