From a3a432c753c19d263d642c379aa1d7c4977b3a6e Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 6 Oct 2022 10:18:19 +0200 Subject: [PATCH] fix: delete one or more expeditions --- modules/ticket/front/expedition/index.html | 11 ++++++----- modules/ticket/front/expedition/index.js | 14 ++++++++++++++ modules/ticket/front/expedition/locale/es.yml | 3 ++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/modules/ticket/front/expedition/index.html b/modules/ticket/front/expedition/index.html index 694b3eb33c..caef67f59e 100644 --- a/modules/ticket/front/expedition/index.html +++ b/modules/ticket/front/expedition/index.html @@ -17,8 +17,9 @@ ng-show="$ctrl.totalChecked"> @@ -88,11 +89,11 @@ - + on-accept="$ctrl.onRemove()"> diff --git a/modules/ticket/front/expedition/index.js b/modules/ticket/front/expedition/index.js index d80c8e812b..1525f97b5d 100644 --- a/modules/ticket/front/expedition/index.js +++ b/modules/ticket/front/expedition/index.js @@ -27,6 +27,20 @@ class Controller extends Section { return this.checked.length; } + async onRemove() { + const params = []; + for (let expedition of this.checked) + params.push(expedition.id); + + for (let id of params) { + await this.$http.delete(`Expeditions/${id}`) + .then(() => { + this.vnApp.showSuccess(this.$t('Expedition removed')); + this.$state.reload(); + }); + } + } + createTicket(routeFk) { const tomorrow = new Date(); const params = { diff --git a/modules/ticket/front/expedition/locale/es.yml b/modules/ticket/front/expedition/locale/es.yml index d23cf25af3..9c7872fd70 100644 --- a/modules/ticket/front/expedition/locale/es.yml +++ b/modules/ticket/front/expedition/locale/es.yml @@ -1 +1,2 @@ -Status log: Hitorial de estados \ No newline at end of file +Status log: Hitorial de estados +Expedition removed: Expedición eliminada \ No newline at end of file