Skip to content

Commit

Permalink
Improve goToReceive formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
azizjonnurov committed Dec 19, 2024
1 parent ef5345f commit 445533f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
16 changes: 6 additions & 10 deletions src/OrderLinesList/Details/OrderLineDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,12 @@ const OrderLineDetails = ({
[lineId, order],
);

const goToReceive = useCallback(
() => {
history.push({
pathname: '/receiving',
search: `qindex=poLine.poLineNumber&query=${line?.poLineNumber}`,
});
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[lineId, line],
);
const goToReceive = useCallback(() => {
history.push({
pathname: '/receiving',
search: `qindex=poLine.poLineNumber&query=${line?.poLineNumber}`,
});
}, [history, line?.poLineNumber]);

const deleteLine = useCallback(
() => {
Expand Down
16 changes: 6 additions & 10 deletions src/components/POLine/POLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,12 @@ function POLine({
[orderId],
);

const goToReceive = useCallback(
() => {
history.push({
pathname: '/receiving',
search: `qindex=poLine.poLineNumber&query=${line?.poLineNumber}`,
});
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[lineId, line],
);
const goToReceive = useCallback(() => {
history.push({
pathname: '/receiving',
search: `qindex=poLine.poLineNumber&query=${line?.poLineNumber}`,
});
}, [history, line?.poLineNumber]);

const deleteLine = useCallback(
() => {
Expand Down

0 comments on commit 445533f

Please sign in to comment.