Skip to content

Commit de0176e

Browse files
committed
adde delete
1 parent 0478bd7 commit de0176e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

client/src/components/ui/card_organization_inventory_details_modal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ interface Inventory_Details_Modal_Interface {
4545
itemData: Inventory_Details_Interface | null; // Data of the item to display
4646
}
4747

48+
const deleteHelper = (id: number, onclose: () => void) => {
49+
deleteItemClean(id || 0);
50+
onclose();
51+
};
52+
4853
const Inventory_Details_Modal: React.FC<Inventory_Details_Modal_Interface> = ({
4954
isOpen,
5055
onClose,
@@ -108,7 +113,7 @@ const Inventory_Details_Modal: React.FC<Inventory_Details_Modal_Interface> = ({
108113
</Link>
109114

110115
<button
111-
onClick={() => deleteItemClean(itemData.id || 0)}
116+
onClick={() => deleteHelper(itemData.id || 0, onClose)}
112117
className="modal-action-button secondary"
113118
>
114119
Delete

0 commit comments

Comments
 (0)