fix: double confirm for project deletion
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user