Skip to content

Commit

Permalink
Update edit-ship-form.tsx
Browse files Browse the repository at this point in the history
Signed-off-by: kirolos <[email protected]>
  • Loading branch information
kokojkj authored Nov 13, 2024
1 parent 3341933 commit f857164
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/harbor/shipyard/edit-ship-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export default function EditShipForm({
setDeleting(true)

e.preventDefault()

// Add delete confirmation dialog
const confirmation = window.confirm(`Are you sure you want to delete "${ship.title}"? This action cannot be undone.`)

if (!confirmation) {
setDeleting(false)
return
}

console.log('trying to delete ', ship.id, ship.title)
await deleteShip(ship.id)

Expand Down

0 comments on commit f857164

Please sign in to comment.