There was an error while loading. Please reload this page.
1 parent 0e3d0fb commit 9ff1749Copy full SHA for 9ff1749
lab-allie/controller/gallery-controller.js
@@ -12,7 +12,7 @@ exports.addPicture = function(req) {
12
if(!req.body.desc) return Promise.reject(createError(400, 'Invalid desc property'));
13
req.body.userId = req.user._id;
14
15
- new Gallery(req.body).save()
+ return new Gallery(req.body).save()
16
.then(gallery => gallery)
17
.catch(err => Promise.reject(createError(400, err.message)));
18
};
0 commit comments