Attempt to have code wait for request to finish

This commit is contained in:
Joel Male
2020-08-26 10:34:42 +10:00
parent cfebc00721
commit db36b9f178
9 changed files with 11 additions and 8 deletions
+3 -2
View File
@@ -305,8 +305,9 @@ var Http = (function () {
}
Http.prototype.make = function (url, headers, body) {
var _this = this;
return new Promise(function () {
fetch(url, _this.getOptions('post', headers, body));
return new Promise(function (resolve, reject) {
fetch(url, _this.getOptions('post', headers, body))
.then(function (res) { return resolve(res); });
});
};
Http.prototype.getOptions = function (method, headers, body) {