refactored tricky function
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
* @description :: Server-side logic for managing files
|
||||
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
|
||||
*/
|
||||
var logEitherWay = function(err, result){
|
||||
if (err) console.log(err);
|
||||
console.log("Created: " + created);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -18,10 +22,7 @@ module.exports = {
|
||||
name: files[i].filename,
|
||||
location: files[i].fd.split("assets/")[1],
|
||||
description: req.body.description
|
||||
}).exec(function(err, created){
|
||||
if (err) console.log(err);
|
||||
console.log("Created :" + created);
|
||||
});
|
||||
}).exec(logEitherWay);
|
||||
}
|
||||
return res.redirect("/#/docs");
|
||||
// return res.json({
|
||||
|
||||
Reference in New Issue
Block a user