From a18c8bcd35b9e41a3ac69f93914abb16577212b5 Mon Sep 17 00:00:00 2001 From: Matti Luukkainen Date: Wed, 4 Sep 2024 15:38:01 +0300 Subject: [PATCH] remove forced sv from validations --- src/validators/options.ts | 2 +- src/validators/questions.ts | 8 ++++---- src/validators/results.ts | 6 +++--- src/validators/survey.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/validators/options.ts b/src/validators/options.ts index 3ab3092..8782cb9 100644 --- a/src/validators/options.ts +++ b/src/validators/options.ts @@ -2,7 +2,7 @@ import { z } from 'zod' const Locales = z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }) diff --git a/src/validators/questions.ts b/src/validators/questions.ts index 5c86f05..dcad019 100644 --- a/src/validators/questions.ts +++ b/src/validators/questions.ts @@ -4,7 +4,7 @@ export const NewQuestionZod = z.object({ parentId: z.number().nullish().default(null), title: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), text: z.object({ @@ -18,13 +18,13 @@ export const NewQuestionZod = z.object({ z.object({ title: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), data: z .object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }) .optional(), @@ -43,7 +43,7 @@ export type NewQuestion = z.infer export const UpdatedQuestionZod = z.object({ title: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), text: z.object({ diff --git a/src/validators/results.ts b/src/validators/results.ts index b90f153..de785e5 100644 --- a/src/validators/results.ts +++ b/src/validators/results.ts @@ -5,7 +5,7 @@ export const NewResultFormZod = z.object({ optionLabel: z.string().nonempty(), isSelected: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), }) @@ -16,7 +16,7 @@ export const NewResultZod = z.object({ optionLabel: z.string().nonempty(), isSelected: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), data: z.record( @@ -34,7 +34,7 @@ export type NewResult = z.infer export const UpdatedResultZod = z.object({ isSelected: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), data: z.record( diff --git a/src/validators/survey.ts b/src/validators/survey.ts index bc61b40..fa8bd4f 100644 --- a/src/validators/survey.ts +++ b/src/validators/survey.ts @@ -3,7 +3,7 @@ import { z } from 'zod' export const UpdatedSurveyInfoZod = z.object({ title: z.object({ fi: z.string().nonempty(), - sv: z.string().nonempty(), + sv: z.string(), en: z.string().nonempty(), }), text: z.object({