diff --git a/web/src/components/FOI/Home/MCFPersonal.js b/web/src/components/FOI/Home/MCFPersonal.js index 51c22911d..357ad47e7 100644 --- a/web/src/components/FOI/Home/MCFPersonal.js +++ b/web/src/components/FOI/Home/MCFPersonal.js @@ -166,7 +166,7 @@ const MCFPersonal = ({ _sectionArray.map((section) => { if(_keyword && section.name.toLowerCase().includes(_keyword.toLowerCase())) { newSectionArray.push(section); - } else if(section.divisionid === _selectedSectionValue) { + } else if(section.name === _selectedSectionValue) { newSectionArray.unshift(section); } }); @@ -221,6 +221,8 @@ const MCFPersonal = ({ }; const handleClose = () => { + setSearchValue(""); + setFileTypeSearchValue(""); setCurrentEditRecord(); setCurPersonalAttributes({ person: "", @@ -234,6 +236,11 @@ const MCFPersonal = ({ setOpenContextPopup(false); }; + const reset = () => { + setSearchValue(""); + setFileTypeSearchValue(""); + }; + const handleFileTypeSearchKeywordChange = (keyword) => { setFileTypeSearchValue(keyword); } @@ -583,13 +590,13 @@ const MCFPersonal = ({ diff --git a/web/src/components/FOI/Home/utils.js b/web/src/components/FOI/Home/utils.js index dbcf9974e..0edbb2f05 100644 --- a/web/src/components/FOI/Home/utils.js +++ b/web/src/components/FOI/Home/utils.js @@ -106,7 +106,7 @@ export const sortDocList = (fullDocList, currentDoc, sortedDocList, requestInfo) if (childDocList.length == 1) { sortedChildDocList = childDocList; } else { - if (requestInfo.bcgovcode === "MCF") { + if (requestInfo?.bcgovcode === "MCF") { sortedChildDocList = childDocList.sort(CFDSorting); } else { sortedChildDocList = childDocList.sort(docSorting);