Add "get all" endpoints

This commit is contained in:
Stone_Red
2022-05-04 11:08:50 +02:00
parent 39d6157a3c
commit 1b162b4f3c
9 changed files with 39 additions and 4 deletions
+6
View File
@@ -85,3 +85,9 @@ export const getRestaurant = async (req: Request, res: Response) => {
res.status(HttpStatusCodes.OK).json(restaurant);
};
export const getRestaurants = async (_req: Request, res: Response) => {
const restaurants = await prisma.restaurant.findMany();
res.status(HttpStatusCodes.OK).json(restaurants);
}