mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Work on brewery page, refactors
Refactor query types to explicitly use z.infer
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const BeerCommentQueryResult = z.object({
|
||||
const BeerCommentQueryResult = z.object({
|
||||
id: z.string().uuid(),
|
||||
content: z.string().min(1).max(300),
|
||||
content: z.string().min(1).max(500),
|
||||
rating: z.number().int().min(1).max(5),
|
||||
createdAt: z.coerce.date(),
|
||||
postedBy: z.object({
|
||||
@@ -10,6 +10,5 @@ export const BeerCommentQueryResult = z.object({
|
||||
username: z.string().min(1).max(50),
|
||||
}),
|
||||
});
|
||||
export const BeerCommentQueryResultArray = z.array(BeerCommentQueryResult);
|
||||
export type BeerCommentQueryResultT = z.infer<typeof BeerCommentQueryResult>;
|
||||
export type BeerCommentQueryResultArrayT = z.infer<typeof BeerCommentQueryResultArray>;
|
||||
|
||||
export default BeerCommentQueryResult;
|
||||
|
||||
Reference in New Issue
Block a user