mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
37 lines
816 B
TypeScript
37 lines
816 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const beerPostQueryResultSchema = 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.date(),
|
|
});
|
|
|
|
export const beerPostQueryResultArraySchema = z.array(beerPostQueryResultSchema);
|
|
|
|
export type BeerPostQueryResult = z.infer<typeof beerPostQueryResultSchema>;
|
|
|
|
export type BeerPostQueryResultArray = z.infer<typeof beerPostQueryResultArraySchema>;
|