-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add array search params #585
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda like the fact that there is 0 import from the lib 🤣
Yes, diffs are big, like this you take a lot of contribution 😉
Phew, this was harder than expected as we do not know if we have an array during the code generation step. So the "logic" to join has to run always. But that does not work correctly if the value is Let me know what you think! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 💪
Few questions and we are good I think ✅
9a9aee0
to
8d671f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs a changeset
and we are good.
Thx for your work.
Let me know if you want to finish it, if not, I can take it from here.
limit: StringOrUndefined(params.limit), | ||
demo: StringOrUndefined(params.demo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be
StringOrUndefined(params?.limit),
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params
is definitively set in line 60. I struggled so long to get the ?.
operator to bet used in the correct places 😅
I used |
@all-contributors please add @fehnomenal for code Thx a lot |
I've put up a pull request to add @fehnomenal! 🎉 |
This is an alternative to #583, where the user can decide whether the array elements should be joined or each have their own occurrence in the search params.
This adds a new option to the explicit search param definition:
joinArray
. It controls whether.join(',')
gets appended in the generated call of theappendSp
function.Otherwise the array gets passed as it is and is turned into many parameters.
fix #580
Side-note: Have you considered not exporting the appendSp string but the function? It would keep the diff smaller if
ROUTES.ts
would import it from the lib 😅