Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. //...
  2. /**
  3. * Deleta um livro da lista
  4. */
  5. {
  6. method: "DELETE",
  7. path: "/v1/books/{id}",
  8. handler: (req, res) => {
  9. BookSchema.findByIdAndRemove(req.params.id)
  10. .then(result => {
  11. res(result).code(204);
  12. })
  13. .then(err => {
  14. console.log(err);
  15. });
  16. },
  17. config: {
  18. validate: {
  19. params: {
  20. id: Joi.string().required().min(20)
  21. }
  22. }
  23. }
  24. }
  25. //..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement