Fix search

This commit is contained in:
Romaric Mourgues
2023-03-28 11:04:46 +02:00
parent bdfa3cb851
commit 1b2a3cc4d9
@@ -20,9 +20,7 @@ export const useSearchDriveItems = () => {
const companyId = useRouterCompany(); const companyId = useRouterCompany();
const { open } = useSearchModal(); const { open } = useSearchModal();
const searchInput = useRecoilValue(SearchInputState); const searchInput = useRecoilValue(SearchInputState);
const [loading, setLoading] = useRecoilState( const [loading, setLoading] = useRecoilState(LoadingState('useSearchDriveItems'));
LoadingState('useSearchDriveItems'),
);
const [searched, setSearched] = useRecoilState(SearchDriveItemsResultsState(companyId)); const [searched, setSearched] = useRecoilState(SearchDriveItemsResultsState(companyId));
const [recent, setRecent] = useRecoilState(RecentDriveItemsState(companyId)); const [recent, setRecent] = useRecoilState(RecentDriveItemsState(companyId));
@@ -31,6 +29,7 @@ export const useSearchDriveItems = () => {
{ {
limit: 25, limit: 25,
workspace_id: searchInput.workspaceId, workspace_id: searchInput.workspaceId,
company_id: companyId,
channel_id: searchInput.channelId, channel_id: searchInput.channelId,
}, },
_.isUndefined, _.isUndefined,
@@ -52,7 +51,7 @@ export const useSearchDriveItems = () => {
const update = { const update = {
results, results,
nextPage: "", nextPage: '',
// nextPage: response.next_page_token, // nextPage: response.next_page_token,
}; };
@@ -89,4 +88,4 @@ export const useSearchDriveItems = () => {
); );
return { loading, driveItems: searched.results, loadMore, refresh }; return { loading, driveItems: searched.results, loadMore, refresh };
}; };