fix(admin): series Delete button actually deletes the series

The /admin/series Delete handler only PUT-unlinked each event and never
called the DELETE /api/admin/series/[id] endpoint, so the series document
persisted (a no-op for empty series). Replace the redundant per-event loop
with a single DELETE call — the endpoint already unlinks events server-side.
Unskip the e2e delete test.
This commit is contained in:
Jennie Robinson Faber 2026-05-24 22:17:19 +01:00
parent eb6449de43
commit a9312c423b
2 changed files with 31 additions and 14 deletions

View file

@ -604,15 +604,7 @@ const deleteSeries = (series) => {
confirmAction.execute = async () => {
confirmAction.running = true
try {
for (const event of series.events) {
await $fetch(`/api/admin/events/${event.id}`, {
method: 'PUT',
body: {
...event,
series: { isSeriesEvent: false, id: '', title: '', description: '', type: 'workshop_series', position: 1, totalEvents: null },
},
})
}
await $fetch(`/api/admin/series/${series.id}`, { method: 'DELETE' })
confirmAction.show = false
await refresh()
} catch (error) {