feat: add reusable confirmation dialogs for destructive actions
This commit is contained in:
@@ -95,7 +95,7 @@ export default function Attachments({ jobId }: { jobId: number }) {
|
||||
};
|
||||
|
||||
const remove = async (a: AttachmentItem) => {
|
||||
if (!confirmAction(`Delete attachment "${a.fileName}"?`)) return;
|
||||
if (!(await confirmAction(`Delete attachment "${a.fileName}"?`, { title: "Delete attachment", confirmLabel: "Delete", destructive: true }))) return;
|
||||
try {
|
||||
await api.delete(`/attachments/${a.id}`);
|
||||
toast("Deleted attachment.", "success");
|
||||
|
||||
Reference in New Issue
Block a user