amadeus4dev-examples / amadeus-flight-booking-node

Node.js and Vue application demonstrating the Amadeus Self-Service flight booking APIs
https://developers.amadeus.com
MIT License
16 stars 25 forks source link

Flight search not working #34

Closed tsolakoua closed 3 years ago

tsolakoua commented 3 years ago

When we do a flight search, the app breaks. It looks like the input from the frontend doesn't pass correctly in the backend.

For example this is the input in the frontend we can see in the console: Screenshot 2021-09-15 at 18 16 53

However, when we call the Flight Offers Search API it looks like the dates taken are the default ones from the calendar (check https://github.com/amadeus4dev/amadeus-flight-booking-node/issues/31).

Apart from that, even though in the frontend we define a return date, returnDate is not existing at all in the API call.

ClientError {
  response: Response {
    contentType: 'application/vnd.amadeus+json',
    statusCode: 400,
    request: Request {
      host: 'test.api.amadeus.com',
      port: 443,
      ssl: true,
      scheme: 'https',
      verb: 'GET',
      path: '/v2/shopping/flight-offers',
      params: [Object],
      queryPath: '/v2/shopping/flight-offers?originLocationCode=MAD&destinationLocationCode=ATH&departureDate=2020-05-01&adults=1',
      bearerToken: '',
      clientVersion: '4.0.0',
      languageVersion: '13.8.0',
      appId: null,
      appVersion: null,
      headers: [Object]
    },
    body: '{"errors":[{"status":400,"code":425,"title":"INVALID DATE","detail":"Date/Time is in the past","source":{}}]}',
    result: { errors: [Array] },
    data: undefined,
    parsed: true
  },
  description: [
    {
      status: 400,
      code: 425,
      title: 'INVALID DATE',
      detail: 'Date/Time is in the past',
      source: {}
    }
  ],
  code: 'ClientError'
}
ipgpt commented 3 years ago

Hi! I'm ready to help with it

tsolakoua commented 3 years ago

You can take it the issue @ipgpt :)