Skip to content

Commit

Permalink
feat: add confirm for delete task
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelncui committed Oct 13, 2023
1 parent b0505b4 commit 4550992
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/components/job-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import { RefreshContext } from "../pages/jobs";
const DeleteJobButton = ({ jobID }: { jobID: bigint }) => {
const refresh = useContext(RefreshContext);
const deleteJob = useCallback(async () => {
if (!confirm(`Delete job ${jobID}, this may cause data loss.`)) {
return;
}

await cli.jobDelete(JobDeleteRequest.create({ ids: [jobID] }));
await refresh();
}, [jobID]);
Expand Down

0 comments on commit 4550992

Please sign in to comment.