Continue work on brewery page, implement like system

This commit is contained in:
Aaron William Po
2023-04-23 17:25:39 -04:00
parent 9504da33d6
commit 58d30b605f
27 changed files with 699 additions and 125 deletions

View File

@@ -4,9 +4,14 @@ import { z } from 'zod';
const prisma = DBClient.instance;
const getAllBreweryPosts = async () => {
const getAllBreweryPosts = async (pageNum?: number, pageSize?: number) => {
const skip = pageNum && pageSize ? (pageNum - 1) * pageSize : undefined;
const take = pageNum && pageSize ? pageSize : undefined;
const breweryPosts: z.infer<typeof BreweryPostQueryResult>[] =
await prisma.breweryPost.findMany({
skip,
take,
select: {
id: true,
location: true,