misc: Rename beer type to beer style

This commit is contained in:
Aaron William Po
2023-09-18 15:44:56 -04:00
parent 6b8682e686
commit af09928c3c
30 changed files with 1192 additions and 183 deletions

View File

@@ -19,7 +19,7 @@ const getBeerRecommendations = async ({
const beerRecommendations: z.infer<typeof BeerPostQueryResult>[] =
await DBClient.instance.beerPost.findMany({
where: {
OR: [{ typeId: beerPost.type.id }, { breweryId: beerPost.brewery.id }],
OR: [{ styleId: beerPost.style.id }, { breweryId: beerPost.brewery.id }],
NOT: { id: beerPost.id },
},
select: {
@@ -29,7 +29,7 @@ const getBeerRecommendations = async ({
abv: true,
description: true,
createdAt: true,
type: { select: { name: true, id: true } },
style: { select: { name: true, id: true, description: true } },
brewery: { select: { name: true, id: true } },
postedBy: { select: { id: true, username: true } },
beerImages: { select: { path: true, caption: true, id: true, alt: true } },
@@ -40,7 +40,7 @@ const getBeerRecommendations = async ({
const count = await DBClient.instance.beerPost.count({
where: {
OR: [{ typeId: beerPost.type.id }, { breweryId: beerPost.brewery.id }],
OR: [{ styleId: beerPost.style.id }, { breweryId: beerPost.brewery.id }],
NOT: { id: beerPost.id },
},
});