From 3af26900e36410aab8c1b7521b7db139b341253d Mon Sep 17 00:00:00 2001 From: Joan Sanchez <joan@verdnatura.es> Date: Tue, 24 Sep 2019 11:55:36 +0200 Subject: [PATCH] watcher preventing claim creation --- modules/ticket/front/sale/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index c783a321e4..31e2ee155d 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -246,12 +246,11 @@ class Controller { sales: this.transfer.sales }; + this.$scope.watcher.updateOriginalData(); + const query = `/api/tickets/${this.ticket.id}/transferSales`; this.$http.post(query, params).then(res => { - this.$scope.watcher.updateOriginalData(); this.goToTicket(res.data.id); - }).finally(() => { - this.$scope.watcher.updateOriginalData(); }); } @@ -262,6 +261,10 @@ class Controller { ticketCreated: this.ticket.shipped }; const sales = this.checkedLines(); + + if (this.newInstances().length === 0) + this.$scope.watcher.updateOriginalData(); + this.$http.post(`/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => { this.$state.go('claim.card.basicData', {id: res.data.id}); });