mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Did more work to beer post page, seed
Worked on comments and beer recs features. Fine tuning database seed amounts.
This commit is contained in:
22
validation/CreateBeerCommentValidationSchema.ts
Normal file
22
validation/CreateBeerCommentValidationSchema.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const BeerCommentValidationSchema = z.object({
|
||||
content: z
|
||||
.string()
|
||||
.min(1, {
|
||||
message: 'Comment must not be empty.',
|
||||
})
|
||||
.max(300, {
|
||||
message: 'Comment must be less than 300 characters.',
|
||||
}),
|
||||
rating: z
|
||||
.number()
|
||||
.int()
|
||||
.min(1, { message: 'Rating must be greater than 1.' })
|
||||
.max(5, { message: 'Rating must be less than 5.' }),
|
||||
beerPostId: z.string().uuid({
|
||||
message: 'Beer post ID must be a valid UUID.',
|
||||
}),
|
||||
});
|
||||
|
||||
export default BeerCommentValidationSchema;
|
||||
Reference in New Issue
Block a user