formatting
This commit is contained in:
@@ -9,7 +9,7 @@ exports.create = (req, res, next) => {
|
|||||||
const { name, amount, monthly, causes, regions, organizations } = req.body;
|
const { name, amount, monthly, causes, regions, organizations } = req.body;
|
||||||
|
|
||||||
return sequelize
|
return sequelize
|
||||||
.transaction(function(t) {
|
.transaction(function (t) {
|
||||||
return Grant.create(
|
return Grant.create(
|
||||||
{
|
{
|
||||||
donor_id,
|
donor_id,
|
||||||
@@ -28,7 +28,7 @@ exports.create = (req, res, next) => {
|
|||||||
]).then(result => grant);
|
]).then(result => grant);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(function(grants) {
|
.then(function (grants) {
|
||||||
// transaction committed
|
// transaction committed
|
||||||
// res.status(201).json({
|
// res.status(201).json({
|
||||||
// grant,
|
// grant,
|
||||||
@@ -38,7 +38,7 @@ exports.create = (req, res, next) => {
|
|||||||
next(grants.dataValues);
|
next(grants.dataValues);
|
||||||
return null;
|
return null;
|
||||||
})
|
})
|
||||||
.catch(function(error) {
|
.catch(function (error) {
|
||||||
// transaction rollback
|
// transaction rollback
|
||||||
next(error);
|
next(error);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user