phone_routes.js 861 B

123456789101112131415161718192021222324252627282930
  1. const phone_ctrl = require('../controllers/phone_ctrl');
  2. const person_ctrl = require('../controllers/person_ctrl');
  3. module.exports = [
  4. {
  5. url: '/person/:person_id/phone',
  6. method: 'get',
  7. func: [person_ctrl.load_by_id, phone_ctrl.get_all]
  8. },
  9. {
  10. url: '/person/:person_id/phone',
  11. method: 'post',
  12. func: [person_ctrl.load_by_id, phone_ctrl.create]
  13. },
  14. {
  15. url: '/person/:person_id/phone/:phone_id',
  16. method: 'get',
  17. func: [person_ctrl.load_by_id, phone_ctrl.get_by_id]
  18. },
  19. {
  20. url: '/person/:person_id/phone/:phone_id',
  21. method: 'put',
  22. func: [person_ctrl.load_by_id, phone_ctrl.update_by_id]
  23. },
  24. {
  25. url: '/person/:person_id/phone/:phone_id',
  26. method: 'delete',
  27. func: [person_ctrl.load_by_id, phone_ctrl.delete_by_id]
  28. }
  29. ]