merging create grant and stripe calls

This commit is contained in:
Arjun Patel
2019-02-02 19:33:44 -08:00
parent 49c470ab47
commit 226f5c1149
9 changed files with 112 additions and 27 deletions
+12 -2
View File
@@ -20,10 +20,20 @@ router.get('/grants/', checkAuth(roles.DONOR), controllers.grant.findByDonorId);
* - monthly true or false
* - donor_id
* */
router.post('/grants/', checkAuth(roles.DONOR), controllers.grant.create);
router.post(
'/grants/',
checkAuth(roles.DONOR),
controllers.grant.create,
controllers.stripe.grantCharge
);
// DELECT a grant of a donor
router.delete('/grants/', checkAuth(roles.DONOR), controllers.grant.delete);
router.delete(
'/grants/',
checkAuth(roles.DONOR),
controllers.stripe.deleteGrant,
controllers.grant.delete
);
// POST to get suggested organizations to distribute to
// running "the algorithm"
+4 -1
View File
@@ -3,9 +3,12 @@ const express = require('express'),
checkAuth = require('../middleware/check-auth'),
roles = require('../helpers/roles');
const controller = require('../controllers/stripe.controller');
const controller = require('../controllers/donor/stripe.controller');
// POST create one time or monthly charge for grant
router.post('/donor/grant', checkAuth(roles.DONOR), controller.grantCharge);
// DELETE grant's plan under subscription
router.delete('/donor/grant', checkAuth(roles.DONOR), controller.deleteGrant);
module.exports = router;