driver delete button added modal confirmation

dilmurod
Dilmurod 6 days ago
parent 38fa5ae3f6
commit 8ed28f4b58

@ -12,6 +12,7 @@ import {
Input,
Button,
Select,
Modal,
} from "antd";
import { customerController } from "../../API/LayoutApi/customers";
import Notfound from "../../Utils/Notfound";
@ -54,13 +55,20 @@ const CustomerEdit = () => {
};
const ClickDelete = () => {
const shouldDelete = window.confirm(
"Are you sure, you want to delete this Driver?"
);
if (shouldDelete && id !== undefined) {
Modal.confirm({
title: "Are you sure you want to delete this Driver?",
okText: "Yes",
okType: "danger",
cancelText: "No",
onOk() {
if (id !== undefined) {
customerController.deleteCustomerController(id);
navigate(-1);
navigate("/customers/");
refetch();
}
},
});
};
const [activeTab, setActiveTab] = useState("1");

Loading…
Cancel
Save