fix: remove delete button on master data
This commit is contained in:
parent
787e74419e
commit
d7cb7df6ba
|
@ -94,7 +94,6 @@ export const CategoryComponent = observer((props) => {
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Button onClick={() => handleEditButton(record)}>Edit</Button>
|
<Button onClick={() => handleEditButton(record)}>Edit</Button>
|
||||||
<Button onClick={() => handleDelete(record.id)}>Delete</Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -112,22 +111,6 @@ export const CategoryComponent = observer((props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = (id) => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: "Are you sure delete this record?",
|
|
||||||
icon: <ExclamationCircleOutlined />,
|
|
||||||
okText: "Yes",
|
|
||||||
okType: "primary",
|
|
||||||
cancelText: "Cancel",
|
|
||||||
onOk() {
|
|
||||||
return deleteData(id);
|
|
||||||
},
|
|
||||||
onCancel() {
|
|
||||||
console.log("Cancel");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
setIdData("");
|
setIdData("");
|
||||||
store.category.visibleModalCategory = false;
|
store.category.visibleModalCategory = false;
|
||||||
|
|
|
@ -56,44 +56,11 @@ export const SubcategoryComponent = observer((props) => {
|
||||||
<Button
|
<Button
|
||||||
onClick={() => handleEditButton(record)}
|
onClick={() => handleEditButton(record)}
|
||||||
>Edit</Button>
|
>Edit</Button>
|
||||||
<Button
|
|
||||||
onClick={() => handleDelete(record.id)}
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const deleteData = async (id) => {
|
|
||||||
try {
|
|
||||||
console.log(id);
|
|
||||||
await store.category.delete(id);
|
|
||||||
message.success("Data Berhasil Dihapus");
|
|
||||||
history.push(LINKS.PRODUCT);
|
|
||||||
} catch (err) {
|
|
||||||
console.log("error", err);
|
|
||||||
message.error("Gagal menghapus");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDelete = (id) => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: "Are you sure delete this record?",
|
|
||||||
icon: <ExclamationCircleOutlined/>,
|
|
||||||
okText: "Yes",
|
|
||||||
okType: "primary",
|
|
||||||
cancelText: "Cancel",
|
|
||||||
onOk() {
|
|
||||||
return deleteData(id);
|
|
||||||
},
|
|
||||||
onCancel() {
|
|
||||||
console.log("Cancel");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
setIdData('')
|
setIdData('')
|
||||||
store.subcategory.visibleModalSubcategory = false;
|
store.subcategory.visibleModalSubcategory = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user