Skip to content

Commit

Permalink
don't include rating in google places api response
Browse files Browse the repository at this point in the history
  • Loading branch information
mgm1313 committed Sep 11, 2024
1 parent 9ffbf0b commit 1f2d975
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions apps/web/src/app/(public)/vaarlocaties/_lib/retrieve-locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,20 @@ async function retrieveLocationsWithAllMeta() {
place_id: location.googlePlaceId,
language: Language.nl,
key: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
fields: [
"rating",
"user_ratings_total",
"address_components",
"geometry",
"url",
],
fields: ["address_components", "geometry", "url"],
},
})
.catch((error) => {
console.error("Error retrieving place details", location.name);
throw error;
});

const { rating, user_ratings_total, address_components, geometry, url } =
placeDetails.data.result;
const { address_components, geometry, url } = placeDetails.data.result;

return {
...location,
rating,
user_ratings_total,
rating: undefined,
user_ratings_total: undefined,
geometry,
googleUrl: url,
province: address_components?.find(
Expand Down

0 comments on commit 1f2d975

Please sign in to comment.