diff --git a/packages/discovery-react-components/src/components/DiscoverySearch/__tests__/DiscoverySearch.test.tsx b/packages/discovery-react-components/src/components/DiscoverySearch/__tests__/DiscoverySearch.test.tsx index 144b92391..aeddb0602 100644 --- a/packages/discovery-react-components/src/components/DiscoverySearch/__tests__/DiscoverySearch.test.tsx +++ b/packages/discovery-react-components/src/components/DiscoverySearch/__tests__/DiscoverySearch.test.tsx @@ -327,7 +327,7 @@ describe('DiscoverySearch', () => { expect(spy).toHaveBeenCalledWith({ projectId: 'foo', filter: 'document_id::bar', - collection_ids: ['12345-12345-12345-12345'], + collectionIds: ['12345-12345-12345-12345'], aggregation: '', passages: { enabled: false diff --git a/packages/discovery-react-components/src/utils/__tests__/useDataApi.test.tsx b/packages/discovery-react-components/src/utils/__tests__/useDataApi.test.tsx index 9cd9131e3..f782c3cf8 100644 --- a/packages/discovery-react-components/src/utils/__tests__/useDataApi.test.tsx +++ b/packages/discovery-react-components/src/utils/__tests__/useDataApi.test.tsx @@ -799,7 +799,7 @@ describe('useFetchDocumentsApi', () => { fireEvent.click(fetchDocumentsButton, { target: { value: 'filter_string' } }); expect(checkParametersMock).toHaveBeenCalledWith({ projectId: 'foo', - collection_ids: ['12345-12345-12345-12345'], + collectionIds: ['12345-12345-12345-12345'], _return: [], aggregation: '', passages: {}, diff --git a/packages/discovery-react-components/src/utils/useDataApi.ts b/packages/discovery-react-components/src/utils/useDataApi.ts index b5bd50235..e283dee03 100644 --- a/packages/discovery-react-components/src/utils/useDataApi.ts +++ b/packages/discovery-react-components/src/utils/useDataApi.ts @@ -454,9 +454,11 @@ export const useFetchDocumentsApi = ( const fetchDocuments: FetchDocumentsActions['fetchDocuments'] = useCallback( (filter, collections, callback) => { - setSearchParameters((currentSearchParameters: DiscoveryV2.QueryParams) => { - return { ...currentSearchParameters, filter, collection_ids: collections }; - }); + setSearchParameters( + (currentSearchParameters: DiscoveryV2.QueryParams): DiscoveryV2.QueryParams => { + return { ...currentSearchParameters, filter, collectionIds: collections }; + } + ); setFetchToken({ trigger: true, callback }); }, [setSearchParameters, setFetchToken]