Hotel results are not showing via api call in Amadeus

Viewed 36

I have used Amadeus self-service API to build a hotel booking app. The City/airport search is working fine. The Date filter is also working.

The only problem is Hotels results are not showing or empty Results are showing.

I am not getting what mistake I have done. Any help will be appreciated.

Edits:

I have put an console.log here, I can see the cityCode, checkInDate and checkoutdate but can't see the response in the console.

// Querying hotels
router.get(`/${API}/hotels`, async (req, res) => {
  try {
    const { cityCode, checkInDate, checkOutDate } = req.query;
    console.log(cityCode, checkInDate, checkOutDate);
    const response = await amadeus.shopping.hotelOffers.get({
      cityCode,
      checkInDate,
      checkOutDate,
    });
    consloe.log(response);
    await res.json(JSON.parse(response.body));
  } catch (err) {
    await res.json(err);
  }
});

enter image description here

0 Answers
Related