Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more types #969

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Fix more types #969

merged 4 commits into from
Oct 10, 2024

Conversation

andrejak
Copy link
Contributor

Fixes issues reported in #936 (guide) and #945.

@andrejak andrejak requested a review from a team as a code owner October 10, 2024 11:29
@@ -316,12 +318,12 @@ export interface CreateOfferRequestSlice {
/**
* The inclusive time range for the arrival of the slice
*/
arrival_time?: string | null
arrival_time?: TimeRangeFilter | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the undefined please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to provide these filters though, even as null? From reading the examples on here I didn't think so: https://duffel.com/docs/guides/following-search-best-practices
Below are both valid:
Screenshot 2024-10-10 at 12 44 10
Screenshot 2024-10-10 at 12 44 02

I guess I'm not sure if the sides of the filter can be null, but I can't find the descriptions in the actual API reference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concept of null or undefined to the API is the same I guess. Whether we send the attribute set to null or don't send it at all. But i did notice that when we do redefine or reference some of these types on the dashboard they may mismatch because one side expects undefined to be part of the type vs not. Or some places where we only check if null. Not big deal though if you'd prefer to keep the undefined so we don't need to add to objects when using them.


/**
* The inclusive time range for the departure of the slice
*/
departure_time?: string | null
departure_time?: TimeRangeFilter | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[2] Can we remove the undefined please?

jekku
jekku previously approved these changes Oct 10, 2024
Copy link
Contributor

@jekku jekku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense relative to the couple of other issues.

Just to double check here are the V2 yaml definitions:

igorp1
igorp1 previously approved these changes Oct 10, 2024
@andrejak andrejak dismissed stale reviews from igorp1 and jekku via 754e0d0 October 10, 2024 14:48
@andrejak andrejak merged commit 16bfff3 into main Oct 10, 2024
4 checks passed
@andrejak andrejak deleted the fix-more-types branch October 10, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants