Merged PR 2295: resolved lint warnings
resolved lint warnings Related work items: #22873
This commit is contained in:
@@ -28,9 +28,15 @@ function AppealsTab(props) {
|
||||
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||
|
||||
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
|
||||
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
|
||||
const searchResultsObj = props.searchResultsObj.searchResultsObj;
|
||||
const {
|
||||
searchResultsObj: searchResultsState,
|
||||
setSearchResults,
|
||||
setSearchDetails
|
||||
} = props;
|
||||
|
||||
const searchDetailsObj = searchResultsState.searchDetailsObj || {};
|
||||
const resultsArr = searchResultsState.searchResultsObj.value || [];
|
||||
const searchResultsObj = searchResultsState.searchResultsObj;
|
||||
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
@@ -75,20 +81,14 @@ function AppealsTab(props) {
|
||||
fieldSort,
|
||||
selectedOption
|
||||
).then((data) => {
|
||||
props.setSearchResults(data); // ✅ use props, not import
|
||||
setSearchResults(data);
|
||||
return getSearchDetailsPaged(data).then((details) => {
|
||||
props.setSearchDetails(details); // ✅ use props, not import
|
||||
setSearchDetails(details);
|
||||
setShowSpinnerState(false);
|
||||
});
|
||||
});
|
||||
},
|
||||
[
|
||||
advancedSearch,
|
||||
searchString,
|
||||
selectedOption,
|
||||
props.setSearchDetails,
|
||||
props.setSearchResults
|
||||
]
|
||||
[selectedOption, setSearchDetails, setSearchResults]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -936,17 +936,16 @@ const DocumentsTab = (props) => {
|
||||
)
|
||||
.then((data) => data)
|
||||
.then((data) => {
|
||||
props.setDocumentDetails(data);
|
||||
setDocumentDetails(data);
|
||||
setShowSpinnerState(false);
|
||||
});
|
||||
},
|
||||
[
|
||||
props.incidentid,
|
||||
selectedOption,
|
||||
selectedDocumentType,
|
||||
selectedWeeks,
|
||||
selectedDocumentOrigin,
|
||||
props.setDocumentDetails
|
||||
setDocumentDetails
|
||||
]
|
||||
);
|
||||
|
||||
@@ -957,7 +956,7 @@ const DocumentsTab = (props) => {
|
||||
orderBy,
|
||||
fieldSort
|
||||
).then((data) => {
|
||||
props.setDocumentDetails(data);
|
||||
setDocumentDetails(data);
|
||||
return data;
|
||||
});
|
||||
|
||||
@@ -1060,7 +1059,7 @@ const DocumentsTab = (props) => {
|
||||
selectedDocumentType,
|
||||
selectedWeeks
|
||||
).then((data) => {
|
||||
props.setDocumentDetails(data);
|
||||
setDocumentDetails(data);
|
||||
setDocumentSearchState(true);
|
||||
|
||||
return data;
|
||||
@@ -1072,13 +1071,11 @@ const DocumentsTab = (props) => {
|
||||
//const searchDocumentResultsObj = docDetailsObj();
|
||||
}, [
|
||||
incidentid,
|
||||
props.setDocumentDetails,
|
||||
setDocumentDetails,
|
||||
selectedOption,
|
||||
selectedDocumentType,
|
||||
fieldSortState,
|
||||
orderByState,
|
||||
getDocumentTypes,
|
||||
getOrigin,
|
||||
getDocumentResults,
|
||||
lang,
|
||||
selectedWeeks
|
||||
@@ -1134,7 +1131,7 @@ const DocumentsTab = (props) => {
|
||||
<select
|
||||
onChange={(e) => {
|
||||
setSelectedWeeks(e.target.value);
|
||||
props.setCurrentPage(1);
|
||||
setCurrentPage(1);
|
||||
}}
|
||||
value={selectedWeeks}
|
||||
className="govuk-select"
|
||||
|
||||
Reference in New Issue
Block a user