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:
@@ -67,6 +67,7 @@ func NewRouter(jwtSecret string, handlers Handlers) http.Handler {
|
||||
r.Get("/devices/{id}/profile", handlers.Device.GetProfileByDeviceID)
|
||||
r.Post("/devices/{id}/revoke", handlers.Device.Revoke)
|
||||
r.Post("/devices/{id}/rotate", handlers.Device.Rotate)
|
||||
r.Delete("/devices/{id}", handlers.Device.Delete)
|
||||
r.Get("/groups", handlers.Group.List)
|
||||
r.Post("/groups", handlers.Group.Create)
|
||||
r.Patch("/groups/{id}", handlers.Group.Update)
|
||||
|
||||
Reference in New Issue
Block a user