refator: trying to delete async and await
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-10-18 14:46:40 +02:00
parent f95f977b69
commit dc62841c3d
1 changed files with 13 additions and 2 deletions

View File

@ -50,6 +50,14 @@ class Controller extends Dialog {
this.$.invoiceButton.disabled = false;
}
invoice() {
const clientAndAddress = clientsAndAddresses[this.pos];
return this.post(`InvoiceOuts/globalInvoicing`, params, options).then(() => {
this.pos++;
this.invoice();
});
}
async responseHandler(response) {
try {
if (response !== 'accept')
@ -69,7 +77,10 @@ class Controller extends Dialog {
this.$.invoiceButton.disabled = true;
if (this.clientsNumber == 'allClients') this.getMaxClientId();
return this.$http.post(`InvoiceOuts/clientToInvoice`, this.invoice)
this.pos = 0;
this.invoice();
this.$http.post(`InvoiceOuts/clientToInvoice`, this.invoice)
.then(async res => {
const invoice = res.data.invoice;
const clientsAndAddresses = res.data.clientsAndAddresses;
@ -91,7 +102,7 @@ class Controller extends Dialog {
const options = {
timeout: this.canceler.promise
};
await this.$http.post(`InvoiceOuts/globalInvoicing`, params, options);
await this.$http.post(`InvoiceOuts/globalInvoicing`, params, options).then();
}
})
.then(() => super.responseHandler(response))