From 4b0c2c60a2bebe258d048d40cb98bbc1ab69e3a4 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 4 Oct 2021 16:00:05 -0700 Subject: [PATCH] IO-1398 Parts Order Mark Duplication --- .../job-detail-lines/job-lines.component.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index b02b26663..9d799b991 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -36,6 +36,7 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re // import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container"; // import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container"; import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container"; +import _ from "lodash"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser @@ -334,10 +335,12 @@ export function JobLinesComponent({ const markedTypes = [e.key]; if (e.key === "PAN") markedTypes.push("PAP"); if (e.key === "PAS") markedTypes.push("PASL"); - setSelectedLines([ - ...selectedLines, - ...jobLines.filter((item) => markedTypes.includes(item.part_type)), - ]); + setSelectedLines( + _.uniq([ + ...selectedLines, + ...jobLines.filter((item) => markedTypes.includes(item.part_type)), + ]) + ); } };