From 47578b531f8b09e0bef76b7b719a136990720a0f Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Thu, 19 Sep 2024 12:38:18 +0200 Subject: [PATCH] :bug: [open-formulieren/open-forms#4637] Ensure value translations are optional :bug: [#4637] Ensure values translations are optional :rewind: [#4637] Revert validation change The validation for `data.values[]` is already applied by `select/edit-validation.ts`. And isn't needed for `selectboxes/edit-validation.ts`. --- src/registry/validation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/registry/validation.ts b/src/registry/validation.ts index 4cd5c5b3..95f7bb1b 100644 --- a/src/registry/validation.ts +++ b/src/registry/validation.ts @@ -84,7 +84,7 @@ export const jsonSchema: z.ZodType = z.lazy(() => // Maps to @open-formulieren/types common.ts Option type. const optionTranslationSchema = z.object({ - label: z.string(), + label: z.string().optional(), }); export const optionSchema = (intl: IntlShape) => @@ -109,7 +109,7 @@ export const optionSchema = (intl: IntlShape) => .object({ // zod doesn't seem to be able to use our supportedLanguageCodes for z.object keys, // they need to be defined statically. So, 'record' it is. - translations: z.record(optionTranslationSchema.optional()), + translations: z.record(z.string(), optionTranslationSchema.optional()), }) .optional(), });