turned publish controller into promise
This commit is contained in:
parent
5c95b5c7ec
commit
edeb933f8a
1 changed files with 30 additions and 27 deletions
|
@ -26,6 +26,7 @@ function upsert (Model, values, condition) {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
publish: (publishParams, fileName, fileType) => {
|
publish: (publishParams, fileName, fileType) => {
|
||||||
|
const deferred = new Promise((resolve, reject) => {
|
||||||
// 1. publish the file
|
// 1. publish the file
|
||||||
lbryApi
|
lbryApi
|
||||||
.publishClaim(publishParams)
|
.publishClaim(publishParams)
|
||||||
|
@ -54,5 +55,7 @@ module.exports = {
|
||||||
// delete the local file
|
// delete the local file
|
||||||
deleteTemporaryFile(publishParams.file_path);
|
deleteTemporaryFile(publishParams.file_path);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
return deferred;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue