Skip to content

Commit

Permalink
fix: typecheck issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Meierschlumpf committed Oct 24, 2024
1 parent 26437d1 commit 6a294c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/validation/src/form/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type CustomErrorKey = keyof TranslationObject["common"]["zod"]["errors"]["custom
export interface CustomErrorParams<TKey extends CustomErrorKey> {
i18n: {
key: TKey;
params?: Record<string, unknown>;
params: Record<string, unknown>;
};
}

Expand Down
10 changes: 8 additions & 2 deletions packages/validation/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ const passwordSchema = z
return passwordRequirements.every((requirement) => requirement.check(value));
},
{
params: createCustomErrorParams("passwordRequirements"),
params: createCustomErrorParams({
key: "passwordRequirements",
params: {},
}),
},
);

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

0 comments on commit 6a294c3

Please sign in to comment.