Skip to content

[FE-13] Implement DeleteAsset confirmation dialog with mutation in opsce folder #778

@yusuftomilola

Description

@yusuftomilola

Problem

The asset detail page has no delete functionality. The existing frontend/components/ui/confirm-dialog.tsx component exists but is not wired to an actual delete API call.

Proposed Solution

Create frontend/opsce/features/assets/DeleteAssetDialog.tsx that wraps the existing ConfirmDialog component with a useDeleteAssetMutation hook.

Acceptance Criteria

  • Dialog shows: "Are you sure you want to delete {asset name}? This action cannot be undone."
  • Confirm button calls DELETE /api/assets/:id
  • On success: closes dialog, navigates back to /assets, shows toast "Asset deleted"
  • On error (e.g., 403 Forbidden): shows an inline error message in the dialog
  • Cancel button closes the dialog without any side effects
  • Confirm button shows a loading spinner while the mutation is in progress

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions