|
|
@@ -6,7 +6,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
import { parse as parseQuerystring } from 'querystring';
|
|
|
|
|
|
import AppContainer from '~/client/services/AppContainer';
|
|
|
-import { IFormattedSearchResult } from '~/interfaces/search';
|
|
|
+import { IPageWithMeta } from '~/interfaces/page';
|
|
|
+import { IFormattedSearchResult, IPageSearchMeta } from '~/interfaces/search';
|
|
|
import { ISelectableAll, ISelectableAndIndeterminatable } from '~/client/interfaces/selectable-all';
|
|
|
import { useIsSearchServiceReachable } from '~/stores/context';
|
|
|
import { ISearchConditions, ISearchConfigurations, useSWRxFullTextSearch } from '~/stores/search';
|
|
|
@@ -113,6 +114,7 @@ export const SearchPage = (props: Props): JSX.Element => {
|
|
|
const [offset, setOffset] = useState<number>(0);
|
|
|
const [limit, setLimit] = useState<number>(INITIAL_PAGIONG_SIZE);
|
|
|
const [configurationsByControl, setConfigurationsByControl] = useState<Partial<ISearchConfigurations>>({});
|
|
|
+ const [searchResultPages, setSearchResultPages] = useState<IPageWithMeta<IPageSearchMeta>[] | undefined>(undefined);
|
|
|
|
|
|
const selectAllControlRef = useRef<ISelectableAndIndeterminatable|null>(null);
|
|
|
const searchPageBaseRef = useRef<ISelectableAll & IReturnSelectedPageIds|null>(null);
|
|
|
@@ -170,6 +172,11 @@ export const SearchPage = (props: Props): JSX.Element => {
|
|
|
mutate();
|
|
|
}, [mutate]);
|
|
|
|
|
|
+ const hoge = useCallback(() => {
|
|
|
+ setSearchResultPages(data?.data);
|
|
|
+ mutate();
|
|
|
+ }, [mutate]);
|
|
|
+
|
|
|
const pagingNumberChangedHandler = useCallback((activePage: number) => {
|
|
|
setOffset((activePage - 1) * limit);
|
|
|
mutate();
|
|
|
@@ -268,13 +275,14 @@ export const SearchPage = (props: Props): JSX.Element => {
|
|
|
<SearchPageBase
|
|
|
ref={searchPageBaseRef}
|
|
|
appContainer={appContainer}
|
|
|
- pages={data?.data}
|
|
|
+ pages={searchResultPages}
|
|
|
searchingKeyword={keyword}
|
|
|
onSelectedPagesByCheckboxesChanged={selectedPagesByCheckboxesChangedHandler}
|
|
|
// Components
|
|
|
searchControl={searchControl}
|
|
|
searchResultListHead={searchResultListHead}
|
|
|
searchPager={searchPager}
|
|
|
+ hoge={hoge}
|
|
|
/>
|
|
|
);
|
|
|
};
|