Skip to content

Commit

Permalink
refactor(fetchers): rename type for search response
Browse files Browse the repository at this point in the history
  • Loading branch information
IdoBouskila committed Nov 30, 2024
1 parent db22dc4 commit 5038321
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/utils/fetchers/fetchers.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import fetchExternalData from './fetch-external-data';
import ExternalSearchResponse from './types/search-locations';
import LocationSearchResponse from './types/search-locations';

export const fetchSearch = async (query: string) => {
const searchParams = new URLSearchParams({ q: query });

const data = await fetchExternalData<ExternalSearchResponse>({
endpoint: '/search.json',
searchParams: searchParams,
});
const data = await fetchExternalData<LocationSearchResponse>({
endpoint: '/search.json',
searchParams: searchParams,
});

return data.map((location) => ({
id: location.id,
Expand Down

0 comments on commit 5038321

Please sign in to comment.