MOBILE-2838 ws: Don't store POST request promises

Since MOBILE-2900 POST request promises are not reused in CoreWSProvider.
main
Albert Gasset 2019-03-18 12:41:34 +01:00
parent 13a9dab037
commit 9134933217
1 changed files with 2 additions and 6 deletions

View File

@ -525,9 +525,9 @@ export class CoreWSProvider {
}
// Perform the post request.
let promise = this.http.post(siteUrl, ajaxData, options).timeout(CoreConstants.WS_TIMEOUT).toPromise();
const promise = this.http.post(siteUrl, ajaxData, options).timeout(CoreConstants.WS_TIMEOUT).toPromise();
promise = promise.then((data: any) => {
return promise.then((data: any) => {
// Some moodle web services return null.
// If the responseExpected value is set to false, we create a blank object if the response is null.
if (!data && !preSets.responseExpected) {
@ -608,10 +608,6 @@ export class CoreWSProvider {
return Promise.reject(this.createFakeWSError('core.serverconnection', true));
});
promise = this.setPromiseHttp(promise, 'post', preSets.siteUrl, ajaxData);
return promise;
}
/**