Files
the-biergarten-app/services/BeerPost/schema/BeerPostQueryResult.ts
Aaron William Po b69dbc95b4 Work on brewery page, refactors
Refactor query types to explicitly use z.infer
2023-03-31 21:13:35 -04:00

19 lines
536 B
TypeScript

import { z } from 'zod';
const beerPostQueryResult = z.object({
id: z.string(),
name: z.string(),
brewery: z.object({ id: z.string(), name: z.string() }),
description: z.string(),
beerImages: z.array(
z.object({ path: z.string(), caption: z.string(), id: z.string(), alt: z.string() }),
),
ibu: z.number(),
abv: z.number(),
type: z.object({ id: z.string(), name: z.string() }),
postedBy: z.object({ id: z.string(), username: z.string() }),
createdAt: z.coerce.date(),
});
export default beerPostQueryResult;