feat: return user data when marking episode as watched

This commit is contained in:
2024-11-14 07:37:04 -05:00
parent 0a07cdc415
commit ce82ae8990
4 changed files with 66 additions and 25 deletions

21
src/types/user.ts Normal file
View File

@@ -0,0 +1,21 @@
import { z } from "zod";
export type User = z.infer<typeof User>;
export const User = z
.object({
statistics: z.object({
minutesWatched: z.number().openapi({ type: "integer", format: "int64" }),
episodesWatched: z.number().openapi({ type: "integer", format: "int64" }),
count: z
.number()
.int() /* .openapi({ type: "integer", format: "int64" }) */,
meanScore: z.number().openapi({ type: "number", format: "float" }),
}),
name: z.string(),
avatar: z.object({
medium: z.string(),
large: z.string(),
}),
})
.optional()
.nullable();