Skip to content

Commit

Permalink
⏪ [#4637] Revert validation change
Browse files Browse the repository at this point in the history
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 19, 2024
1 parent b86b05a commit 0f06226
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/registry/selectboxes/edit-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ import {EditSchema} from '../types';
// object :(
// so we mark each aspect as optional so that *when* it is provided, we can run the
// validation
const valuesSchema = (intl: IntlShape) => ({ values: optionSchema(intl).array().min(1).optional() });
const buildValuesSchema = (intl: IntlShape) =>
z.object({
...valuesSchema(intl),
// The values list can also appear inside a data object
// So repeat the previous rule
data: z.object(valuesSchema(intl)).optional(),
values: optionSchema(intl).array().min(1).optional(),
openForms: z.object({
dataSrc: z.union([z.literal('manual'), z.literal('variable')]),
// TODO: wire up infernologic type checking
Expand Down

0 comments on commit 0f06226

Please sign in to comment.