feat: add wishlist
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
const isoDate = z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Pick a date')
|
||||
const requiredText = z.string().trim().min(1, 'Write something first')
|
||||
|
||||
export const newNoteSchema = z.object({
|
||||
date: isoDate,
|
||||
text: requiredText
|
||||
})
|
||||
|
||||
export const newReviewSchema = z.object({
|
||||
bookId: z.number({ error: 'Pick a book' }).int().positive('Pick a book'),
|
||||
date: isoDate,
|
||||
text: requiredText
|
||||
})
|
||||
|
||||
export const loginSchema = z.object({
|
||||
password: z.string().min(1)
|
||||
})
|
||||
|
||||
export type NewNoteInput = z.output<typeof newNoteSchema>
|
||||
export type NewReviewInput = z.output<typeof newReviewSchema>
|
||||
Reference in New Issue
Block a user