Built motion from commit 06df96e on branch develop.
[motion.git] / server / api / agent / index.js
1 'use strict';
2
3 var express = require('express');
4 var controller = require('./agent.controller');
5 var auth = require('../../auth/auth.service');
6
7 var router = express.Router();
8
9 router.get('/', auth.isAuthenticated(), controller.index);
10 router.get('/:id', auth.isAuthenticated(), controller.show);
11 router.post('/validate/:field', auth.isAuthenticated(), controller.agentValidation);
12 router.post('/', auth.isAuthenticated(), controller.create);
13 router.post('/validate', auth.isAuthenticated(), controller.internalValidation);
14 router.put('/password', auth.isAuthenticated(), controller.changePassword);
15 router.put('/password/:id/reset', auth.isAuthenticated(), auth.hasRole('admin'), controller.resetPassword);
16 router.put('/:id', auth.isAuthenticated(), controller.update);
17 router.patch('/:id', auth.isAuthenticated(), controller.update);
18 router.delete('/', auth.isAuthenticated(), controller.bulkDestroy);
19 router.delete('/:id', auth.isAuthenticated(), controller.destroy);
20
21 module.exports = router;