merging create grant and stripe calls
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user