mirror of
https://github.com/GithubOrgProjectPiza/server.git
synced 2026-09-04 08:36:10 +02:00
Add pizzas to restaurant request
This commit is contained in:
@@ -81,13 +81,20 @@ export const getRestaurant = async (req: Request, res: Response) => {
|
|||||||
where: {
|
where: {
|
||||||
id: id,
|
id: id,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
pizzas: true,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(HttpStatusCodes.OK).json(restaurant);
|
res.status(HttpStatusCodes.OK).json(restaurant);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getRestaurants = async (_req: Request, res: Response) => {
|
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);
|
res.status(HttpStatusCodes.OK).json(restaurants);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user