Add pizzas to restaurant request

This commit is contained in:
Stone_Red
2022-05-23 13:19:58 +02:00
parent 3f65206728
commit c632f1a93a
+8 -1
View File
@@ -81,13 +81,20 @@ export const getRestaurant = async (req: Request, res: Response) => {
where: {
id: id,
},
include: {
pizzas: true,
}
});
res.status(HttpStatusCodes.OK).json(restaurant);
};
export const getRestaurants = async (_req: Request, res: Response) => {
const restaurants = await prisma.restaurant.findMany();
const restaurants = await prisma.restaurant.findMany({
include: {
pizzas: true
}
});
res.status(HttpStatusCodes.OK).json(restaurants);
};