bugfix: use correct url in manual ticket creation
All checks were successful
/ test (pull_request) Successful in 4m9s
/ deploy (push) Successful in 5m17s
/ test (push) Successful in 2m45s

This commit is contained in:
j3d1 2024-12-23 17:12:03 +01:00
parent b393767871
commit f266133d14

View file

@ -339,7 +339,7 @@ const store = createStore({
commit('replaceEvents', [...state.events.filter(e => e.id !== event_id)]) 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); const {data, success} = await http.patch(`/2/events/${id}/`, partial_event, state.user.token);
if (success) { if (success) {
commit('replaceEvents', [...state.events.filter(e => e.id !== id), data]) 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,}) { 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' name: title, sender, body: message, recipient: 'mail@c3lf.de'
}); });
await dispatch('loadTickets'); await dispatch('loadTickets');
@ -456,7 +457,10 @@ const store = createStore({
} }
}, },
async postItemComment({commit, dispatch, state, getters}, {id, message}) { 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) { if (data && success) {
state.fetchedData.items = 0; state.fetchedData.items = 0;
await dispatch('loadEventItems'); await dispatch('loadEventItems');