Skip to content

Commit

Permalink
Deepthi M|Gok-363|Removed editedQuantity state variable as we are not…
Browse files Browse the repository at this point in the history
… editing quantity field now.
  • Loading branch information
deepthi-mantena committed Oct 3, 2023
1 parent 47263f2 commit bcaed65
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/BasicTableModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -87,7 +86,7 @@ useEffect(() => {
const startEditingRow = (rowId) => {
setEditingRowId(rowId);

setIsEditing(true); // Enter editing mode
setIsEditing(true);
};

const handleSaveClick = async (rowId) => {
Expand All @@ -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,
Expand Down Expand Up @@ -177,7 +174,7 @@ useEffect(() => {
ref={editRowRef}
>
<div style={{ paddingRight:'50px' }}>
{editedQuantity[row.id] || cell.value}
{cell.value}
</div>
{isEditing && (
<>
Expand Down

0 comments on commit bcaed65

Please sign in to comment.