From f85716428205ca1443ba4e32a5fe979688ba06c0 Mon Sep 17 00:00:00 2001 From: kirolos <162565862+kokojkj@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:17:54 +0200 Subject: [PATCH] Update edit-ship-form.tsx Signed-off-by: kirolos <162565862+kokojkj@users.noreply.github.com> --- src/app/harbor/shipyard/edit-ship-form.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/harbor/shipyard/edit-ship-form.tsx b/src/app/harbor/shipyard/edit-ship-form.tsx index 625f74d3..1bc47d57 100644 --- a/src/app/harbor/shipyard/edit-ship-form.tsx +++ b/src/app/harbor/shipyard/edit-ship-form.tsx @@ -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)