Skip to content

Commit

Permalink
refactor: fix meilisearch type
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Nov 1, 2023
1 parent f3108a7 commit 108a172
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Category, DiscriminatedItem, INDEX_NAME } from '@graasp/sdk';
import { Category, INDEX_NAME, MeiliSearchResults } from '@graasp/sdk';

import { PartialQueryConfigForApi } from '../types';
import { SEARCH_PUBLISHED_ITEMS_ROUTE } from './routes';
Expand Down Expand Up @@ -34,7 +34,7 @@ export const searchPublishedItems = async (
isPublishedRoot?: boolean;
} & MeiliSearchProps,
{ API_HOST, axios }: PartialQueryConfigForApi,
): Promise<DiscriminatedItem[]> => {
) => {
const query: {
indexUid: string;
attributesToHighlight: string[];
Expand Down Expand Up @@ -72,7 +72,7 @@ export const searchPublishedItems = async (
}

return axios
.post(`${API_HOST}/${SEARCH_PUBLISHED_ITEMS_ROUTE}`, {
.post<MeiliSearchResults>(`${API_HOST}/${SEARCH_PUBLISHED_ITEMS_ROUTE}`, {
queries: [query],
})
.then(({ data }) => data);
Expand Down

0 comments on commit 108a172

Please sign in to comment.