From f266133d1451ca28f73ac55f0e2449c6160bca04 Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 23 Dec 2024 17:12:03 +0100 Subject: [PATCH] bugfix: use correct url in manual ticket creation --- web/src/store.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/src/store.js b/web/src/store.js index 9aa3dd3..aa4820d 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -339,7 +339,7 @@ const store = createStore({ commit('replaceEvents', [...state.events.filter(e => e.id !== event_id)]) } }, - async updateEvent({commit, dispatch, state}, {id, partial_event}){ + async updateEvent({commit, dispatch, state}, {id, partial_event}) { const {data, success} = await http.patch(`/2/events/${id}/`, partial_event, state.user.token); if (success) { commit('replaceEvents', [...state.events.filter(e => e.id !== id), data]) @@ -443,7 +443,8 @@ const store = createStore({ } }, async postManualTicket({commit, dispatch, state, getters}, {sender, message, title,}) { - const {data, success} = await getters.session.post(`/2/tickets/manual/`, { + const slug = getters.getEventSlug; + const {data, success} = await getters.session.post(`/2/${slug !== 'all' ? slug : 'none'}/tickets/manual/`, { name: title, sender, body: message, recipient: 'mail@c3lf.de' }); await dispatch('loadTickets'); @@ -456,7 +457,10 @@ const store = createStore({ } }, async postItemComment({commit, dispatch, state, getters}, {id, message}) { - const {data, success} = await getters.session.post(`/2/${getters.getEventSlug}/item/${id}/comment/`, {comment: message}); + const { + data, + success + } = await getters.session.post(`/2/${getters.getEventSlug}/item/${id}/comment/`, {comment: message}); if (data && success) { state.fetchedData.items = 0; await dispatch('loadEventItems');