mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Refactor
Extract upload middleware to separate file and implement edit profile functionality.
This commit is contained in:
@@ -18,11 +18,14 @@ const getAllBeersByBrewery = async (
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { page_size, page_num, id } = req.query;
|
||||
|
||||
const pageNum = parseInt(page_num, 10);
|
||||
const pageSize = parseInt(page_size, 10);
|
||||
|
||||
const beers: z.infer<typeof BeerPostQueryResult>[] =
|
||||
await DBClient.instance.beerPost.findMany({
|
||||
where: { breweryId: id },
|
||||
take: parseInt(page_size, 10),
|
||||
skip: parseInt(page_num, 10) * parseInt(page_size, 10),
|
||||
skip: (pageNum - 1) * pageSize,
|
||||
take: pageSize,
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
|
||||
Reference in New Issue
Block a user