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];