Skip to content

Commit

Permalink
fix(places): remove floorId param when use Search bar (#581)
Browse files Browse the repository at this point in the history
* fix(places): remove floorId param when use Search bar

* fix(places): fix get places

---------

Co-authored-by: Cristina Ferrian <54667563+Bri74@users.noreply.github.com>
  • Loading branch information
miky41195 and Bri74 authored Feb 7, 2025
1 parent 65adfe4 commit a05baeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/core/queries/placesHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ export const useGetSite = (siteId?: string) => {

export const useGetPlaces = (params: GetPlacesRequest) => {
const placesClient = usePlacesClient();
if (!params.search) {
delete params.search;
}
const key = [PLACES_QUERY_KEY, JSON.stringify(params)];

return useQuery(key, () => placesClient.getPlaces(params), {
Expand Down
4 changes: 2 additions & 2 deletions src/features/places/hooks/useSearchPlaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const useSearchPlaces = ({
placeSubCategoryId: subCategoryId ? [subCategoryId] : undefined,
});
const placesQuery = useGetPlaces({
search,
search: search || undefined,
siteId,
floorId,
floorId: search ? undefined : floorId,
placeCategoryId: categoryId,
placeSubCategoryId: subCategoryId ? [subCategoryId] : undefined,
});
Expand Down

0 comments on commit a05baeb

Please sign in to comment.