diff --git a/web/src/actions/admin/service.ts b/web/src/actions/admin/service.ts index 2266f41..19705ff 100644 --- a/web/src/actions/admin/service.ts +++ b/web/src/actions/admin/service.ts @@ -18,7 +18,7 @@ const serviceSchemaBase = z.object({ slug: z .string() .regex(/^[a-z0-9-]+$/, 'Allowed characters: lowercase letters, numbers, and hyphens') - .nullable(), + .optional(), name: z.string().min(1).max(20), description: z.string().min(1), serviceUrls: stringListOfUrlsSchemaRequired, @@ -28,12 +28,12 @@ const serviceSchemaBase = z.object({ attributes: z.array(z.coerce.number().int().positive()), categories: z.array(z.coerce.number().int().positive()).min(1), verificationStatus: z.nativeEnum(VerificationStatus), - verificationSummary: z.string().nullable(), - verificationProofMd: z.string().nullable(), + verificationSummary: z.string().optional().nullable().default(null), + verificationProofMd: z.string().optional().nullable().default(null), acceptedCurrencies: z.array(z.nativeEnum(Currency)), - referral: z.string().nullable(), + referral: z.string().optional().nullable().default(null), imageFile: imageFileSchema, - overallScore: zodCohercedNumber(z.number().int().min(0).max(10)).nullable(), + overallScore: zodCohercedNumber(z.number().int().min(0).max(10)).optional(), serviceVisibility: z.nativeEnum(ServiceVisibility), }) diff --git a/web/src/pages/admin/services/[slug]/edit.astro b/web/src/pages/admin/services/[slug]/edit.astro index 2f6a1b0..cd25269 100644 --- a/web/src/pages/admin/services/[slug]/edit.astro +++ b/web/src/pages/admin/services/[slug]/edit.astro @@ -170,8 +170,6 @@ const errorTextClasses = 'mt-1 text-xs text-red-400' @@ -1017,12 +1015,10 @@ const errorTextClasses = 'mt-1 text-xs text-red-400'
- - {method.label ?? contactMethodInfo.label} - + {contactMethodInfo.label}

- {contactMethodInfo.formattedValue}{' '} + {method.label ?? contactMethodInfo.formattedValue}{' '} ({method.value})

@@ -1067,7 +1063,7 @@ const errorTextClasses = 'mt-1 text-xs text-red-400' id={`contactLabel-${method.id}`} value={method.label} class={inputBaseClasses} - placeholder={contactMethodInfo.label} + placeholder={contactMethodInfo.formattedValue} />