Update: all queries involving image now use ImageQueryValidationSchema

This commit is contained in:
Aaron William Po
2023-11-11 20:30:07 -05:00
parent 3ea9f67f16
commit d48d9a8886
21 changed files with 180 additions and 49 deletions

View File

@@ -31,7 +31,16 @@ const search = async (req: SearchAPIRequest, res: NextApiResponse) => {
postedBy: { select: { username: true, id: true } },
brewery: { select: { name: true, id: true } },
style: { select: { name: true, id: true, description: true } },
beerImages: { select: { alt: true, path: true, caption: true, id: true } },
beerImages: {
select: {
alt: true,
path: true,
caption: true,
id: true,
createdAt: true,
updatedAt: true,
},
},
},
where: {
OR: [

View File

@@ -34,7 +34,16 @@ const getAllBeersByBrewery = async (
postedBy: { select: { username: true, id: true } },
brewery: { select: { name: true, id: true } },
style: { select: { name: true, id: true, description: true } },
beerImages: { select: { alt: true, path: true, caption: true, id: true } },
beerImages: {
select: {
alt: true,
path: true,
caption: true,
id: true,
createdAt: true,
updatedAt: true,
},
},
},
});