routes.js 827 B

1234567891011121314151617181920
  1. const C = require('./controllers')
  2. const { routes:crudRoutes } = require('@alancnet/material-framework/lib/crud')
  3. module.exports = app => {
  4. app.get('/api/statistics', C.statistics.get)
  5. crudRoutes({ app, apiPrefix: '/api/staff-members/:location', controller: C.staffMember, camelName: 'staffMember' })
  6. // crudRoutes({ app, controller: C.staffMember, camelName: 'staffMember' })
  7. crudRoutes({ app, controller: C.staffingAgency, camelName: 'staffingAgency' })
  8. // Labor
  9. app.get('/api/labor/:location', C.labor.list)
  10. app.get('/api/labor/:location/:week', C.labor.get)
  11. app.patch('/api/labor/:location/:week', C.labor.patch)
  12. // Services
  13. app.get('/api/services/:location', C.services.list)
  14. app.get('/api/services/:location/:week', C.services.get)
  15. app.patch('/api/services/:location/:week', C.services.patch)
  16. }