From 2677f4b8b6c1d614e2bcb3ff3278eb5ea46e33c3 Mon Sep 17 00:00:00 2001 From: jedi Date: Sun, 26 Jan 2025 19:56:25 +0100 Subject: [PATCH] link item to ticket frontend --- web/src/store.js | 9 ++++++++- web/src/views/Ticket.vue | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/web/src/store.js b/web/src/store.js index e747ae7..34650e4 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -61,7 +61,6 @@ const store = createStore({ '2kg-de': '2kg Paket (DE)', '5kg-de': '5kg Paket (DE)', '10kg-de': '10kg Paket (DE)', - '2kg-eu': '2kg Paket (EU)', '5kg-eu': '5kg Paket (EU)', '10kg-eu': '10kg Paket (EU)', } @@ -564,6 +563,14 @@ const store = createStore({ state.fetchedData.tickets = 0; await Promise.all([dispatch('loadTickets'), dispatch('fetchShippingVouchers')]); } + }, + async linkTicketItem({dispatch, state, getters}, {ticket_id, item_id}) { + const {data, success} = await getters.session.post(`/2/matches/`, {issue_thread: ticket_id, item: item_id}); + if (data && success) { + state.fetchedData.tickets = 0; + state.fetchedData.items = 0; + await Promise.all([dispatch('loadTickets'), dispatch('loadEventItems')]); + } } }, plugins: [persistentStatePlugin({ // TODO change remember to some kind of enable field diff --git a/web/src/views/Ticket.vue b/web/src/views/Ticket.vue index dd0b413..220ec3f 100644 --- a/web/src/views/Ticket.vue +++ b/web/src/views/Ticket.vue @@ -81,6 +81,13 @@ Copy DHL contact to clipboard +
+ + +