Trying delete without hit api on Transfertype
This commit is contained in:
@ -19,7 +19,9 @@ const DeleteDialog = () => {
|
||||
message: ''
|
||||
});
|
||||
|
||||
const doDeleteTransferType = useCallback(async () => {
|
||||
|
||||
|
||||
const doDeleteTransferType = useCallback(async (id:string) => {
|
||||
if (!selectedTransferType) {
|
||||
toast.error('No Transfer Type selected');
|
||||
return;
|
||||
@ -40,6 +42,11 @@ const DeleteDialog = () => {
|
||||
// setTimeout(() => toast.error('Failed Delete Product'), 0);
|
||||
}
|
||||
}, [selectedTransferType, DeleteData, handleDeleteDialog, reload]);
|
||||
|
||||
const handleDelete = ((id:string) => {
|
||||
console.log(id);
|
||||
// doDeleteTransferType(id);
|
||||
})
|
||||
return (
|
||||
<Dialog open={showDeleteDialog} onOpenChange={(open) => handleDeleteDialog(open, null)}>
|
||||
<DialogContent className="container-fixed max-w-md flex flex-col p-5 overflow-hidden [&>button]:hidden">
|
||||
@ -60,7 +67,7 @@ const DeleteDialog = () => {
|
||||
<Button variant={'outline'} onClick={() => handleDeleteDialog(false, null)}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant={'destructive'} onClick={() => doDeleteTransferType()}>
|
||||
<Button variant={'destructive'} onClick={() => handleDelete(selectedTransferType)}>
|
||||
Delete
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
Reference in New Issue
Block a user