feat: add i18n translated form errors (#509)

This commit is contained in:
Meier Lukas
2024-05-18 16:55:08 +02:00
committed by GitHub
parent b312032f02
commit dfed804f65
32 changed files with 501 additions and 156 deletions

View File

@@ -183,7 +183,9 @@ export const boardRouter = createTRPCRouter({
);
}),
savePartialBoardSettings: protectedProcedure
.input(validation.board.savePartialSettings)
.input(
validation.board.savePartialSettings.and(z.object({ id: z.string() })),
)
.mutation(async ({ ctx, input }) => {
await throwIfActionForbiddenAsync(
ctx,

View File

@@ -73,7 +73,7 @@ describe("initUser should initialize the first user", () => {
confirmPassword: "12345679",
});
await expect(actAsync()).rejects.toThrow("Passwords do not match");
await expect(actAsync()).rejects.toThrow("passwordsDoNotMatch");
});
it("should not create a user if the password is too short", async () => {

View File

@@ -255,6 +255,7 @@ const createUserAsync = async (
await db.insert(schema.users).values({
id: userId,
name: input.username,
email: input.email,
password: hashedPassword,
salt,
});