-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrouter.js
43 lines (35 loc) · 1.42 KB
/
router.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
33
34
35
36
37
38
39
40
41
42
43
const router = require('koa-router')();
const {
authController,
userController,
petController,
orgController,
} = require('./controllers');
router
.get('/pets/:pet_id', petController.getPet)
.get('/pets', petController.getPets)
.post('/pets', petController.addPet);
router
.get('/orgs', orgController.getOrgs)
.get('/orgs/:org_id', orgController.getOrg)
.post('/orgs', authController.addOrg)
.put('/orgs/:org_id', orgController.adoptionRequest);
router
.get('/users', userController.getUsers)
.get('/users/:usr_id', userController.getUser)
.put('/users/:usr_id/accepted', userController.acceptAdoption)
.put('/users/:usr_id/rejected', userController.rejectAdoption)
.put('/users/:usr_id/markAsRead', userController.markAsRead)
.post('/users', userController.addUser);
// PENDING ROUTES
// router.put('/pets/:pet_id', petController.editPet);
// router.delete('/pets/:pet_id', petController.deletePet);
// router.put('/orgs/:org_id', orgController.editOrg);
// router.put('/orgs/:org_id', orgController.rejectResidence);
// router.delete('/orgs/:org_id', orgController.deleteOrg);
// router.post('/orgs/:org_id/pets', orgController.addPet);
// router.post('/users/:user_id/pets', petController.addPet);
// router.put('/users/:user_id', userController.editUser);
// router.put('/users/:user_id', userController.applyForResidence);
// router.delete('/users/:user_id', userController.deleteUser);
module.exports = router;