mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Add date established to brewery page
This commit is contained in:
@@ -23,6 +23,7 @@ const getAllBeerPosts = async (pageNum: number, pageSize: number) => {
|
||||
},
|
||||
take: pageSize,
|
||||
skip,
|
||||
orderBy: { createdAt: 'desc' },
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -18,7 +18,10 @@ const getAllBreweryPosts = async (pageNum?: number, pageSize?: number) => {
|
||||
name: true,
|
||||
postedBy: { select: { username: true, id: true } },
|
||||
breweryImages: { select: { path: true, caption: true, id: true, alt: true } },
|
||||
createdAt: true,
|
||||
dateEstablished: true,
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
return breweryPosts;
|
||||
|
||||
@@ -13,6 +13,8 @@ const getBreweryPostById = async (id: string) => {
|
||||
name: true,
|
||||
breweryImages: { select: { path: true, caption: true, id: true, alt: true } },
|
||||
postedBy: { select: { username: true, id: true } },
|
||||
createdAt: true,
|
||||
dateEstablished: true,
|
||||
},
|
||||
where: { id },
|
||||
});
|
||||
|
||||
@@ -8,6 +8,8 @@ const BreweryPostQueryResult = z.object({
|
||||
breweryImages: z.array(
|
||||
z.object({ path: z.string(), caption: z.string(), id: z.string(), alt: z.string() }),
|
||||
),
|
||||
createdAt: z.coerce.date(),
|
||||
dateEstablished: z.coerce.date(),
|
||||
});
|
||||
|
||||
export default BreweryPostQueryResult;
|
||||
|
||||
Reference in New Issue
Block a user