-
Notifications
You must be signed in to change notification settings - Fork 8
/
working_groups.js
32 lines (22 loc) · 1.03 KB
/
working_groups.js
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
var express = require('express');
var router = express.Router();
var isAuthenticated = require('../server.js').isAuthenticated;
var list = require('../controllers/working_groups/list');
var list_by_institute = require('../controllers/working_groups/list_by_institute');
var post = require('../controllers/working_groups/post');
var get = require('../controllers/working_groups/get');
var put = require('../controllers/working_groups/put');
var del = require('../controllers/working_groups/delete');
// LIST
router.get('/working_groups', list.request);
// LIST BY INSTITUTE
router.get('/institutes/:institute_id/working_groups', list_by_institute.request);
// POST (ONLY ADMINS)
router.post('/working_groups', isAuthenticated, post.request);
// GET
router.get('/working_groups/:working_group_id', get.request);
// PUT (ONLY ADMINS)
router.put('/working_groups/:working_group_id', isAuthenticated, put.request);
// DELETE (ONLY ADMINS)
router.delete('/working_groups/:working_group_id', isAuthenticated, del.request);
module.exports = router;