fix(server): get personal bests request mode2 should be optional

!nuf
This commit is contained in:
Miodec 2024-09-06 15:06:01 +02:00
parent 715bc0ec23
commit d5fb24fb12
2 changed files with 2 additions and 5 deletions

View file

@ -2407,10 +2407,7 @@ describe("user controller test", () => {
//THEN
expect(body).toEqual({
message: "Invalid query schema",
validationErrors: [
'"mode" Required',
'"mode2" Needs to be either a number, "zen" or "custom".',
],
validationErrors: ['"mode" Required'],
});
});
it("should fail with unknown query parameters", async () => {

View file

@ -89,7 +89,7 @@ export type UpdatePasswordRequest = z.infer<typeof UpdatePasswordRequestSchema>;
export const GetPersonalBestsQuerySchema = z.object({
mode: ModeSchema,
mode2: Mode2Schema,
mode2: Mode2Schema.optional(),
});
export type GetPersonalBestsQuery = z.infer<typeof GetPersonalBestsQuerySchema>;