From d25eb674c6dfafd925f52e96c90f3af02d72de1d Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Mon, 26 Feb 2018 15:54:17 -0500 Subject: [PATCH] make climate happy --- src/controllers/uploads.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js index b14d878230..af89b8c287 100644 --- a/src/controllers/uploads.js +++ b/src/controllers/uploads.js @@ -73,14 +73,10 @@ function uploadAsImage(req, uploadedFile, callback) { resizeImage(fileObj, next); }, - ], function (err, fileObj) { - if (err) { - return callback(err); - } - - delete fileObj.path; - callback(null, fileObj); - }); + function (fileObj, next) { + next(null, { url: fileObj.url }); + }, + ], callback); } function uploadAsFile(req, uploadedFile, callback) { @@ -97,14 +93,10 @@ function uploadAsFile(req, uploadedFile, callback) { } uploadsController.uploadFile(req.uid, uploadedFile, next); }, - ], function (err, fileObj) { - if (err) { - return callback(err); + function (fileObj, next) { + next(null, { url: fileObj.url }); } - - delete fileObj.path; - callback(null, fileObj); - }); + ], callback); } function resizeImage(fileObj, callback) {