Fix missing hash on upload

parent bfd8bd94
...@@ -49,14 +49,14 @@ module.exports = function (storage, metadataStorage, options) { ...@@ -49,14 +49,14 @@ module.exports = function (storage, metadataStorage, options) {
}; };
let addMetadata = (hash) => { let addMetadata = (hash) => {
return metadataStorage.addRecord(hash, mimetype, size); return metadataStorage.addRecord(hash, mimetype, size).then(() => hash);
}; };
let deleteFile = () => { let deleteFile = () => {
return fs.unlink(tmpPath); return fs.unlink(tmpPath);
}; };
let sendResponse = () => { let sendResponse = (hash) => {
response.json({ response.json({
id: hash, id: hash,
filename: filename, filename: filename,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment