Last active
November 13, 2019 14:53
-
-
Save jwoyo/2eafb99ab73c51334432a921dd9f63c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.delete("/:restaurantId", [onlyLoggedInUsers, restaurantOwnerOnlyMiddleware], (req, res) => { | |
// an user which doesn't fulfill the preconditions from the middlewares above, will not reach the code below | |
// do your delete operation here | |
res.send(); | |
}); | |
// you can simple re-use the implementation above | |
app.put("/:restaurantId", [onlyLoggedInUsers, restaurantOwnerOnlyMiddleware], (req, res) => { | |
// do your put operation here | |
res.send(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment