From 59ad3ca415136fb0d373e678988c8d05c24db0b0 Mon Sep 17 00:00:00 2001 From: npy11 Date: Tue, 10 Dec 2024 19:38:32 +0530 Subject: [PATCH] ENDPOINT modification --- blocks/moredetailsaddress/moredetailsaddress.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/blocks/moredetailsaddress/moredetailsaddress.js b/blocks/moredetailsaddress/moredetailsaddress.js index a4bb1f0d9..2b78a34e0 100644 --- a/blocks/moredetailsaddress/moredetailsaddress.js +++ b/blocks/moredetailsaddress/moredetailsaddress.js @@ -161,8 +161,17 @@ function returnLatLan() { }); } -async function getReviewRating(placeID) { - const response = await fetchAPI("GET", `/content/piramalfinance/api/mapapi.json?place_id=${placeID}&key=${GOOGLE_MAPS_API_KEY}`); +async function getReviewRating(placeIDs) { + let requestObj = { + requestJson : { + placeIds: "", + googleKey : "" + } + }; + requestObj.requestJson.placeIds = placeIDs; + requestObj.requestJson.googleKey = GOOGLE_MAPS_API_KEY; + const response = await fetchAPI("POST", '/content/piramalfinance/api/mapapi.json', requestObj); + // const response = await fetchAPI("GET", `/content/piramalfinance/api/mapapi.json?place_id=${placeID}&key=${GOOGLE_MAPS_API_KEY}`); // const response = await fetchAPI("GET", `https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeID}&key=${GOOGLE_MAPS_API_KEY}`); return response.json(); }