server v1.0.7

This commit is contained in:
2020-10-01 20:21:01 +02:00
parent 5d6c7d5e3f
commit 63c2fb88e0
6 changed files with 33 additions and 37 deletions

View File

@@ -59,6 +59,7 @@ router.put("/", async (req, res) => {
const user = validateUserToken(token);
const oldRestaurant = await fetchRestaurant(req.body.restaurantId);
const newRestaurant = await createRestaurant(req.body, oldRestaurant);
await verifyRestaurantAccess(req.body.restaurantId, user);
await Restaurant.replaceOne({ _id: req.body.restaurantId }, newRestaurant);
res.send(newRestaurant);
} catch (error) {