Work on brewery page, refactors

Refactor query types to explicitly use z.infer
This commit is contained in:
Aaron William Po
2023-03-31 21:13:35 -04:00
parent d8a8dad37f
commit b69dbc95b4
33 changed files with 308 additions and 243 deletions

View File

@@ -1,10 +1,13 @@
export default interface BreweryPostQueryResult {
id: string;
location: string;
name: string;
postedBy: {
id: string;
firstName: string;
lastName: string;
};
}
import { z } from 'zod';
const BreweryPostQueryResult = z.object({
id: z.string(),
location: z.string(),
name: z.string(),
postedBy: z.object({ id: z.string(), username: z.string() }),
breweryImages: z.array(
z.object({ path: z.string(), caption: z.string(), id: z.string(), alt: z.string() }),
),
});
export default BreweryPostQueryResult;