fix: double confirm for project deletion

This commit is contained in:
Zhi
2026-03-12 12:55:16 +00:00
parent dceb836385
commit 5e8d4ada0a

View File

@@ -79,7 +79,11 @@ export default function ProjectDetailPage() {
}
const deleteProject = async () => {
if (!confirm('Delete this project?')) return
const confirmName = prompt(`Type the project name "${project?.name}" to confirm deletion:`)
if (confirmName !== project?.name) {
alert('Project name does not match. Deletion cancelled.')
return
}
await api.delete(`/projects/${id}`)
navigate('/projects')
}