refactor: juan changes
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
50ec41dece
commit
5918b3e0df
|
@ -62,6 +62,7 @@ class Controller extends Dialog {
|
|||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
});
|
||||
|
||||
this.$.invoiceButton.disabled = true;
|
||||
return this.$http.post(`InvoiceOuts/clientToInvoice`, this.invoice)
|
||||
.then(async res => {
|
||||
const clientsAndAddresses = res.data.clientsAndAddresses;
|
||||
|
@ -69,7 +70,6 @@ class Controller extends Dialog {
|
|||
|
||||
if (!clientsAndAddresses.length) return super.responseHandler(response);
|
||||
this.lastClientId = clientsAndAddresses[clientsAndAddresses.length - 1].clientId;
|
||||
this.$.invoiceButton.setAttribute('disabled', true);
|
||||
for (let clientAndAddress of clientsAndAddresses) {
|
||||
this.currentClientId = clientAndAddress.clientId;
|
||||
const params = {
|
||||
|
@ -93,13 +93,14 @@ class Controller extends Dialog {
|
|||
.then(() => super.responseHandler(response))
|
||||
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')))
|
||||
.finally(() => {
|
||||
this.lastClientId = null;
|
||||
this.$.invoiceButton.removeAttribute('disabled');
|
||||
this.lastClientId = null; // unificar en una función
|
||||
this.$.invoiceButton.disabled = false; // unificar en una función
|
||||
});
|
||||
} catch (e) {
|
||||
this.vnApp.showError(this.$t(e.message));
|
||||
this.lastClientId = null;
|
||||
this.$.invoiceButton.removeAttribute('disabled');
|
||||
this.lastClientId = null; // unificar en una función
|
||||
this.$.invoiceButton.disabled = false; // unificar en una función
|
||||
throw e;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue