sale now rolls back to olda data when it cant update the price

This commit is contained in:
gerard 2018-08-07 16:06:44 +02:00
parent 65ffade0a3
commit f170f7b621
2 changed files with 4 additions and 1 deletions

View File

@ -228,7 +228,7 @@
label="Price"
model="$ctrl.editedPrice"
type="text"
accept="$ctrl.updatePrice()">
on-change="$ctrl.updatePrice()">
<t-right-icons>
<span class="filter"></span>
</t-right-icons>

View File

@ -309,6 +309,9 @@ class Controller {
this.$http.post(`/ticket/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.$scope.model.refresh();
}).catch(e => {
this.vnApp.showError(e.data.error.message);
this.$scope.model.refresh();
});
}