diff --git a/src/pages/PublicNotice/Search_GLD/SearchForm.js b/src/pages/PublicNotice/Search_GLD/SearchForm.js index 2fea903..b72d557 100644 --- a/src/pages/PublicNotice/Search_GLD/SearchForm.js +++ b/src/pages/PublicNotice/Search_GLD/SearchForm.js @@ -26,8 +26,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss const [orgCombo, setOrgCombo] = React.useState(); const [issueSelected, setIssueSelected] = React.useState({}); const [issueCombo, setIssueCombo] = React.useState([]); - const [selectedStatus, setSelectedStatus] = React.useState([]); - const [selectedLabelsString, setSelectedLabelsString] = React.useState(''); + const [selectedStatus, setSelectedStatus] = React.useState({key: 0, label: 'All', type: 'all'}); const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); @@ -38,7 +37,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss const marginBottom = 2.5; const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { - data.status = selectedLabelsString + data.status = selectedStatus.type let typeArray = []; for (let i = 0; i < type.length; i++) { @@ -75,7 +74,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss // setStatus({ key: 0, label: 'All', type: 'all' }); setOrgSelected({}); setIssueSelected({}); - setSelectedStatus([]); + setSelectedStatus({key: 0, label: 'All', type: 'all'}); reset(); } @@ -188,29 +187,28 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss + { + setSelectedStatus(newValue); + + }} + getOptionLabel={(option) => option.label} + renderInput={(params) => ( + + )} + /> {/* options} - options={ComboData.publicNoticeStatic_GLD} - value={status} - inputValue={status?.label} - onChange={(event, newValue) => { - if (newValue !== null) { - setStatus(newValue); - } - }} - renderInput={(params) => ( - - )} - InputLabelProps={{ - shrink: true - }} - /> */} - )} - /> + /> */} {