Fix vendors validation

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-11-06 18:05:21 +01:00
parent eb0ce9281d
commit a63705619a
2 changed files with 34 additions and 34 deletions

View File

@@ -11,18 +11,18 @@ const schema = z.object({
name: z.string().min(1, "Name is required"),
description: z.string().optional().nullable(),
category: z.string().nullish(),
statusPageUrl: z.string().optional(),
termsOfServiceUrl: z.string().optional(),
privacyPolicyUrl: z.string().optional(),
serviceLevelAgreementUrl: z.string().optional(),
dataProcessingAgreementUrl: z.string().optional(),
websiteUrl: z.string().optional(),
legalName: z.string().optional(),
headquarterAddress: z.string().optional(),
statusPageUrl: z.string().optional().nullable(),
termsOfServiceUrl: z.string().optional().nullable(),
privacyPolicyUrl: z.string().optional().nullable(),
serviceLevelAgreementUrl: z.string().optional().nullable(),
dataProcessingAgreementUrl: z.string().optional().nullable(),
websiteUrl: z.string().optional().nullable(),
legalName: z.string().optional().nullable(),
headquarterAddress: z.string().optional().nullable(),
certifications: z.array(z.string()),
countries: z.array(z.string()),
securityPageUrl: z.string().optional(),
trustPageUrl: z.string().optional(),
securityPageUrl: z.string().optional().nullable(),
trustPageUrl: z.string().optional().nullable(),
businessOwnerId: z.string().nullish(),
securityOwnerId: z.string().nullish(),
});
@@ -76,20 +76,20 @@ export function useVendorForm(vendorKey: useVendorFormFragment$key) {
const defaultValues = useMemo(
() => ({
name: vendor.name,
description: vendor.description ?? "",
category: vendor.category ?? null,
statusPageUrl: vendor.statusPageUrl ?? "",
termsOfServiceUrl: vendor.termsOfServiceUrl ?? "",
privacyPolicyUrl: vendor.privacyPolicyUrl ?? "",
serviceLevelAgreementUrl: vendor.serviceLevelAgreementUrl ?? "",
dataProcessingAgreementUrl: vendor.dataProcessingAgreementUrl ?? "",
websiteUrl: vendor.websiteUrl ?? "",
legalName: vendor.legalName ?? "",
headquarterAddress: vendor.headquarterAddress ?? "",
description: vendor.description || null,
category: vendor.category || null,
statusPageUrl: vendor.statusPageUrl || null,
termsOfServiceUrl: vendor.termsOfServiceUrl || null,
privacyPolicyUrl: vendor.privacyPolicyUrl || null,
serviceLevelAgreementUrl: vendor.serviceLevelAgreementUrl || null,
dataProcessingAgreementUrl: vendor.dataProcessingAgreementUrl || null,
websiteUrl: vendor.websiteUrl || null,
legalName: vendor.legalName || null,
headquarterAddress: vendor.headquarterAddress || null,
certifications: [...(vendor.certifications ?? [])],
countries: [...(vendor.countries ?? [])],
securityPageUrl: vendor.securityPageUrl ?? "",
trustPageUrl: vendor.trustPageUrl ?? "",
securityPageUrl: vendor.securityPageUrl || null,
trustPageUrl: vendor.trustPageUrl || null,
businessOwnerId: vendor.businessOwner?.id,
securityOwnerId: vendor.securityOwner?.id,
}),

View File

@@ -41,20 +41,20 @@ export function CreateVendorDialog({
: {
organizationId,
name: vendor.name,
description: vendor.description,
headquarterAddress: vendor.headquarterAddress,
legalName: vendor.legalName,
websiteUrl: vendor.websiteUrl,
category: vendor.category,
privacyPolicyUrl: vendor.privacyPolicyUrl,
serviceLevelAgreementUrl: vendor.serviceLevelAgreementUrl,
dataProcessingAgreementUrl: vendor.dataProcessingAgreementUrl,
description: vendor.description || null,
headquarterAddress: vendor.headquarterAddress || null,
legalName: vendor.legalName || null,
websiteUrl: vendor.websiteUrl || null,
category: vendor.category || null,
privacyPolicyUrl: vendor.privacyPolicyUrl || null,
serviceLevelAgreementUrl: vendor.serviceLevelAgreementUrl || null,
dataProcessingAgreementUrl: vendor.dataProcessingAgreementUrl || null,
certifications: vendor.certifications,
countries: vendor.countries,
securityPageUrl: vendor.securityPageUrl,
trustPageUrl: vendor.trustPageUrl,
statusPageUrl: vendor.statusPageUrl,
termsOfServiceUrl: vendor.termsOfServiceUrl,
securityPageUrl: vendor.securityPageUrl || null,
trustPageUrl: vendor.trustPageUrl || null,
statusPageUrl: vendor.statusPageUrl || null,
termsOfServiceUrl: vendor.termsOfServiceUrl || null,
};
createVendor({
variables: {