feat(web): wire the delete-application admin UI (BUNYIP-65) #83
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-65-delete-applications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
bunyip-api already exposed
DELETE /admin/applications/{id}(admin-only, gated on the admin's password + 2FA code, all foreign keys cascade, audit-logged viaApplicationDeleted), but no part of bunyip-web reached it. Admins could create and edit applications but never delete one.Fix
This is purely the missing web wiring; no API or schema change.
admin_api::delete_applicationposts the credentials as the DELETE JSON body the API expects ({ password, totp_code }).application_edit) mirrors the account self-delete UI: it collects the admin's password and 2FA code, confirms via a native dialog, and posts to the new route.POST /admin/applications/{id}/delete(application_delete): on success returns to/admin/applications; on failure (bad password or 2FA code) it bounces back to the edit page's danger zone with the API's validation message via an?error=query param, so the admin sees why rather than landing on a blank page.Notes
Test
just check-containergreen: fmt + clippy (-D warnings) + workspace lib tests all pass.#BUNYIP-65
The API already exposed `DELETE /admin/applications/{id}` (admin-only, gated on the admin's password + 2FA code, FKs cascade, audit-logged) but nothing in bunyip-web reached it, so applications could be created and edited but never removed. Add a Danger Zone to the application edit page that mirrors the account self-delete: it collects the admin's password and 2FA code, confirms via a native dialog, and posts to a new `POST /admin/applications/{id}/delete` route. The handler calls the API with both credentials; on success it returns to the applications list, and on failure (bad password or 2FA code) it bounces back to the edit page's danger zone with the API's validation message via an `?error=` param. `admin_api::delete_application` sends the credentials as the DELETE JSON body the API expects. No API or schema changes: this is purely the missing web wiring. #BUNYIP-65 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>