duffel-api-javascript icon indicating copy to clipboard operation
duffel-api-javascript copied to clipboard

`departure_time` and `departure_time` in offer request slices should not be typed as strings

Open markoleavy opened this issue 1 year ago • 0 comments

Hello! According to the api guide, the departure_time and departure_time in offer request should be an object { from?: string, to?:string }, but on the client are typed as strings.

const result = await duffel.partialOfferRequests.create({
    slices: [
      {
        origin: params.origin,
        destination: params.destination,
        departure_date: params.departure.date,
        arrival_time: {
          from: params.departure.from,
          to: params.departure.to,
        },
      },
      {
        origin: params.destination,
        destination: params.origin,
        departure_date: params.departure.date,
        departure_time: {
          from: params.departure.from,
          to: params.departure.to,
        },
      },
    ],
    passengers: new Array(params.numberOfPassengers).fill({
      fare_type: 'adult',
    }),
    cabin_class: 'economy',
  });

markoleavy avatar Jul 09 '24 15:07 markoleavy