From b02199eb07e63ac60ece266ab3139fdc74fba6ed Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 24 Oct 2024 12:03:49 +0200 Subject: [PATCH 1/3] fix: reload window when price is recalculated --- src/pages/Ticket/Card/TicketSale.vue | 1 + src/pages/Ticket/Card/TicketSaleMoreActions.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index f179257f7..3e89e96bf 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -476,6 +476,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); :ticket-config="ticketConfig" @get-mana="getMana()" @update-discounts="updateDiscount" + @re-calculated-price="resetChanges" /> { const calculateSalePrice = async () => { if (!props.sales) return; + console.log('CALLED'); await axios.post(`Sales/recalculatePrice`, props.sales); notify(t('globals.dataSaved'), 'positive'); + emit('reCalculatedPrice', props.sales); }; const changeMultipleDiscount = () => { From c9e82f2caf728a475440d6faf4a0d447edc51129 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 24 Oct 2024 12:04:54 +0200 Subject: [PATCH 2/3] refactor: deleted log --- src/pages/Ticket/Card/TicketSaleMoreActions.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue index a35e21f3f..43ba39b91 100644 --- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue +++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue @@ -105,7 +105,6 @@ const showSmsDialog = (template) => { const calculateSalePrice = async () => { if (!props.sales) return; - console.log('CALLED'); await axios.post(`Sales/recalculatePrice`, props.sales); notify(t('globals.dataSaved'), 'positive'); emit('reCalculatedPrice', props.sales); From 994237260ed24fef644c6fdc5c4091a52607f89d Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 25 Oct 2024 06:48:09 +0200 Subject: [PATCH 3/3] refactor: changed name of emitted event --- src/pages/Ticket/Card/TicketSale.vue | 2 +- src/pages/Ticket/Card/TicketSaleMoreActions.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index 3e89e96bf..798d629c7 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -476,7 +476,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); :ticket-config="ticketConfig" @get-mana="getMana()" @update-discounts="updateDiscount" - @re-calculated-price="resetChanges" + @refresh-table="resetChanges" /> { await axios.post(`Sales/recalculatePrice`, props.sales); notify(t('globals.dataSaved'), 'positive'); - emit('reCalculatedPrice', props.sales); + emit('refreshTable', props.sales); }; const changeMultipleDiscount = () => {