diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-11 04:34:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-11 04:34:59 +0900 |
| commit | 0119c28f7bf6ebd5ba88ef406a242a4ecfda945e (patch) | |
| tree | e83cc933a9e8f55cd089bbd531ecf9006ea4ede9 /src/server/schemas/index.ts | |
| parent | f6ee5c1b6fb70e6f1182ee615051e0085a65b71b (diff) | |
| download | kioku-0119c28f7bf6ebd5ba88ef406a242a4ecfda945e.tar.gz kioku-0119c28f7bf6ebd5ba88ef406a242a4ecfda945e.tar.zst kioku-0119c28f7bf6ebd5ba88ef406a242a4ecfda945e.zip | |
refactor(server): avoid using Zod deprecated API
Diffstat (limited to 'src/server/schemas/index.ts')
| -rw-r--r-- | src/server/schemas/index.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/schemas/index.ts b/src/server/schemas/index.ts index 05b926a..0227ebe 100644 --- a/src/server/schemas/index.ts +++ b/src/server/schemas/index.ts @@ -18,7 +18,7 @@ export const ratingSchema = z.union([ // User schema export const userSchema = z.object({ - id: z.string().uuid(), + id: z.uuid(), username: z.string().min(1).max(255), passwordHash: z.string(), createdAt: z.coerce.date(), @@ -44,8 +44,8 @@ export const refreshTokenSchema = z.object({ // Deck schema export const deckSchema = z.object({ - id: z.string().uuid(), - userId: z.string().uuid(), + id: z.uuid(), + userId: z.uuid(), name: z.string().min(1).max(255), description: z.string().max(1000).nullable(), newCardsPerDay: z.number().int().min(0).default(20), @@ -71,8 +71,8 @@ export const updateDeckSchema = z.object({ // Card schema export const cardSchema = z.object({ - id: z.string().uuid(), - deckId: z.string().uuid(), + id: z.uuid(), + deckId: z.uuid(), front: z.string().min(1), back: z.string().min(1), @@ -107,9 +107,9 @@ export const updateCardSchema = z.object({ // ReviewLog schema export const reviewLogSchema = z.object({ - id: z.string().uuid(), - cardId: z.string().uuid(), - userId: z.string().uuid(), + id: z.uuid(), + cardId: z.uuid(), + userId: z.uuid(), rating: ratingSchema, state: cardStateSchema, scheduledDays: z.number().int().min(0), |
