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
+8 -5
View File
@@ -28,12 +28,15 @@ exports.create = (req, res, next) => {
]).then(result => grant);
});
})
.then(function(grant) {
.then(function(grants) {
// transaction committed
res.status(201).json({
grant,
message: 'Grant Created'
});
// res.status(201).json({
// grant,
// message: 'Grant Created'
// });
req.grant = grants.dataValues;
next();
})
.catch(function(error) {
// transaction rollback