Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //...
- /**
- * Deleta um livro da lista
- */
- {
- method: "DELETE",
- path: "/v1/books/{id}",
- handler: (req, res) => {
- BookSchema.findByIdAndRemove(req.params.id)
- .then(result => {
- res(result).code(204);
- })
- .then(err => {
- console.log(err);
- });
- },
- config: {
- validate: {
- params: {
- id: Joi.string().required().min(20)
- }
- }
- }
- }
- //..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement