Skip to content

Commit

Permalink
Merge pull request #4817 from bcgov/dev-rook-ST-4671-4677
Browse files Browse the repository at this point in the history
Dev rook st 4671 4677
  • Loading branch information
sumathi-thirumani authored Dec 1, 2023
2 parents f59adde + cb95b33 commit e51e859
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ const useOIPCHook = () => {
}
const [oipcData, setOipcData] = useState(requestDetails.oipcdetails);
const [isOIPCReview, setIsOIPCReview] = useState(requestDetails.isoipcreview);

const [resettoInitial, setResettoInitial] = useState(false);
useEffect(() => {
if (resettoInitial == false) {
const stagedOIPCData = stageOIPCData(isOIPCReview, requestDetails.oipcdetails);
setOipcData(stagedOIPCData);
}
}, [isOIPCReview])

//OIPC Functions
Expand All @@ -59,11 +61,17 @@ const useOIPCHook = () => {
})
}
const removeOIPC = (oipcId) => {
if (oipcData.length == 1) {
setOipcData([]);
setResettoInitial(true)
}
else {
setOipcData((prev) => {
const previousOIPCData = [...prev];
return previousOIPCData.filter(oipc => oipcId !== oipc.id);
return previousOIPCData.filter(oipc => oipcId !== oipc.id);
});
}
}
const updateOIPC = (newOIPCObj) => {
setOipcData((prev) => {
const previousOIPCData = [...prev];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.request-flag {

margin-left: -50px;
padding-top: 50px;

.request-flag-dropdown-all {
Expand Down

0 comments on commit e51e859

Please sign in to comment.