Closed randomprogramming closed 8 months ago
Hi @randomprogramming, thanks for reaching out. Where did you learn "now you need to pass in a Place for the origin and destination objects"? Please let me know if you've seen that in our documentation so we can correct it. You will find that on the api reference of the create offer request endpoint slice's origin and destination must be a 3 letter string of the iata code for a city or airport:
The getting started guide seems to agree with that. Please do let me know if there's a mistake on the docs though, so we can correct asap. Thanks!
Maybe I am misunderstanding something, but:
Typescript gives me the error Type 'string' is not assignable to type 'Place'.ts(2322) typings.d.ts(1652, 13): The expected type comes from property 'origin' which is declared here on type 'Omit<OfferRequestSlice, "origin_type" | "destination_type">'
for all of these.
Ah I see, you are not misunderstanding it. The types for origin and destination are incorrect. I just opened a PR to correct that. Thanks for letting me know and sorry for the trouble!
PR was just merged @randomprogramming. If you have any trouble please reach out!
I started reading the documentation here: https://duffel.com/docs/guides/getting-started-with-flights
Looked at the code:
But it seems that this way of searching for flights is not available anymore, now you need to pass in a
Place
for the origin and destination objects.