Skip to content

Commit

Permalink
🐛 [open-formulieren/open-forms#4637] Ensure value translations are op…
Browse files Browse the repository at this point in the history
…tional

🐛 [#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`.
  • Loading branch information
robinmolen committed Sep 24, 2024
1 parent b8c2117 commit 47578b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/registry/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const jsonSchema: z.ZodType<Json> = 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) =>
Expand All @@ -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(),
});
Expand Down

0 comments on commit 47578b5

Please sign in to comment.