Skip to content

Node.js based forum software built for the modern web

make climate happy

Baris Usaklid25eb674c6df
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) {