All files / server/api/locations locations.routes.js

100% Statements 11/11
100% Branches 0/0
100% Functions 0/0
100% Lines 11/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 381x   1x 1x 1x   1x     1x         1x         1x           1x           1x         1x  
const express = require('express');
 
const auth = require('../utils/auth');
const controller = require('./locations.api');
const policy = require('./locations.policy');
 
const router = express.Router();
 
// POST /api/locations
router.post('/',
  auth.authorize(policy.canCreate),
  controller.create);
 
// GET /api/locations
router.get('/',
  auth.authorize(policy.canList, { authenticationRequired: false }),
  controller.list);
 
// GET /api/locations/:id
router.get('/:id',
  controller.fetchLocation,
  auth.authorize(policy.canRetrieve, { authenticationRequired: false }),
  controller.retrieve);
 
// PATCH /api/locations/:id
router.patch('/:id',
  controller.fetchLocation,
  auth.authorize(policy.canUpdate),
  controller.update);
 
// DELETE /api/locations/:id
router.delete('/:id',
  controller.fetchLocation,
  auth.authorize(policy.canDestroy),
  controller.destroy);
 
module.exports = router;