feat: add device deletion endpoint with cascade cleanup and admin UI integration

Add DELETE /admin/devices/{id} endpoint with cascade deletion of device records, WireGuard peers, IP allocations, and device access profile settings. Update device status to 'deleted' and set deleted_at timestamp while preserving revoked_at if already set.

Add deleteDevice API method and delete button to devices page with query invalidation for both devices and device-profile lists. Record admin.device.deleted audit
This commit is contained in:
2026-03-19 22:59:07 +01:00
parent a8a88140af
commit b199b58840
7 changed files with 82 additions and 0 deletions

View File

@@ -225,6 +225,10 @@ export const api = {
method: "POST",
body: JSON.stringify({})
}),
deleteDevice: (deviceId: string) =>
request<{ ok: boolean }>(`/admin/devices/${deviceId}`, {
method: "DELETE"
}),
rotateDevice: (deviceId: string) =>
request<{ ok: boolean }>(`/admin/devices/${deviceId}/rotate`, {
method: "POST",