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
  • Loading branch information
robinmolen committed Sep 24, 2024
1 parent cf82e1e commit 1c748fa
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 1c748fa

Please sign in to comment.