Skip to content

Commit 9ff1749

Browse files
committed
refactoring controllers and routes before testing
1 parent 0e3d0fb commit 9ff1749

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lab-allie/controller/gallery-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports.addPicture = function(req) {
1212
if(!req.body.desc) return Promise.reject(createError(400, 'Invalid desc property'));
1313
req.body.userId = req.user._id;
1414

15-
new Gallery(req.body).save()
15+
return new Gallery(req.body).save()
1616
.then(gallery => gallery)
1717
.catch(err => Promise.reject(createError(400, err.message)));
1818
};

0 commit comments

Comments
 (0)