From bcaed65dce7e71dd60cec740a8858f660cc15d02 Mon Sep 17 00:00:00 2001 From: deepthi-m Date: Tue, 3 Oct 2023 13:50:52 +0530 Subject: [PATCH] Deepthi M|Gok-363|Removed editedQuantity state variable as we are not editing quantity field now. --- src/components/BasicTableModal/index.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/BasicTableModal/index.jsx b/src/components/BasicTableModal/index.jsx index cc59f3f..0ebc8bd 100644 --- a/src/components/BasicTableModal/index.jsx +++ b/src/components/BasicTableModal/index.jsx @@ -38,7 +38,6 @@ const TableModal = (props) => { const [saveClicked, setSaveClicked] = useState(false); const [isEditing, setIsEditing] = useState(false); const editRowRef = useRef(null); - const [editedQuantity, setEditedQuantity] = useState({}); const { data: stockRoom, error: stockRoomError } = useSWR( stockRoomURL(cookies[locationCookieName]?.name.trim()), @@ -87,7 +86,7 @@ useEffect(() => { const startEditingRow = (rowId) => { setEditingRowId(rowId); - setIsEditing(true); // Enter editing mode + setIsEditing(true); }; const handleSaveClick = async (rowId) => { @@ -97,8 +96,6 @@ useEffect(() => { if (editedRow) { const { productName, quantity, actualQuantity, expiration, batchNumber } = editedRow; - const editedQuantityValue = editedQuantity[rowId] || quantity; - const response = await saveEditedQuantity( productName, quantity, @@ -177,7 +174,7 @@ useEffect(() => { ref={editRowRef} >
- {editedQuantity[row.id] || cell.value} + {cell.value}
{isEditing && ( <>