turned publish controller into promise

This commit is contained in:
bill bittner 2017-06-26 10:49:03 -07:00
parent 5c95b5c7ec
commit edeb933f8a

View file

@ -26,6 +26,7 @@ function upsert (Model, values, condition) {
module.exports = {
publish: (publishParams, fileName, fileType) => {
const deferred = new Promise((resolve, reject) => {
// 1. publish the file
lbryApi
.publishClaim(publishParams)
@ -54,5 +55,7 @@ module.exports = {
// delete the local file
deleteTemporaryFile(publishParams.file_path);
});
});
return deferred;
},
};