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:
parent
eb6449de43
commit
a9312c423b
2 changed files with 31 additions and 14 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue