diff --git a/src/pages/PublicNotice/Search_GLD/SearchForm.js b/src/pages/PublicNotice/Search_GLD/SearchForm.js index 4d2b812..a2b0165 100644 --- a/src/pages/PublicNotice/Search_GLD/SearchForm.js +++ b/src/pages/PublicNotice/Search_GLD/SearchForm.js @@ -45,8 +45,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu dateFrom: data.dateFrom, dateTo: data.dateTo, contact: data.contact, - // status: (status?.type && status?.type != 'all') ? status?.type : "", - status: data.status, + status: (data.status === '' || data.status.includes("all")) ? "" : data.status, orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", issueId: issueSelected?.id, groupNo: data.groupNo, @@ -197,12 +196,19 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu value={selectedStatus} onChange={(event, newValue) => { - console.log(newValue) - const selectedLabels = newValue.map(option => option.type); - const selectedLabelsString = `${selectedLabels.join(',')}`; - console.log(selectedLabelsString) - setSelectedStatus(newValue); - setSelectedLabelsString(selectedLabelsString); + const findAllIndex = newValue.findIndex((ele) => { + return ele.type === "all" + }) + + if (findAllIndex > -1) { + setSelectedStatus([newValue[findAllIndex]]); + setSelectedLabelsString('all') + } else { + const selectedLabels = newValue.map(option => option.type); + const selectedLabelsString = `${selectedLabels.join(',')}`; + setSelectedStatus(newValue); + setSelectedLabelsString(selectedLabelsString); + } }} getOptionLabel={(option) => option.label} renderInput={(params) => (