From 6a294c3cf6848c3fdc09c9be16deca57aad13d41 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Thu, 24 Oct 2024 23:52:30 +0200 Subject: [PATCH] fix: typecheck issue --- packages/validation/src/form/i18n.ts | 2 +- packages/validation/src/user.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/validation/src/form/i18n.ts b/packages/validation/src/form/i18n.ts index 39031a182..db53d1e95 100644 --- a/packages/validation/src/form/i18n.ts +++ b/packages/validation/src/form/i18n.ts @@ -133,7 +133,7 @@ type CustomErrorKey = keyof TranslationObject["common"]["zod"]["errors"]["custom export interface CustomErrorParams { i18n: { key: TKey; - params?: Record; + params: Record; }; } diff --git a/packages/validation/src/user.ts b/packages/validation/src/user.ts index 566e43363..65bac9500 100644 --- a/packages/validation/src/user.ts +++ b/packages/validation/src/user.ts @@ -30,7 +30,10 @@ const passwordSchema = z return passwordRequirements.every((requirement) => requirement.check(value)); }, { - params: createCustomErrorParams("passwordRequirements"), + params: createCustomErrorParams({ + key: "passwordRequirements", + params: {}, + }), }, ); @@ -38,7 +41,10 @@ const confirmPasswordRefine = [ (data: { password: string; confirmPassword: string }) => data.password === data.confirmPassword, { path: ["confirmPassword"], - params: createCustomErrorParams("passwordsDoNotMatch"), + params: createCustomErrorParams({ + key: "passwordsDoNotMatch", + params: {}, + }), }, // eslint-disable-next-line @typescript-eslint/no-explicit-any ] satisfies [(args: any) => boolean, unknown];