-
Notifications
You must be signed in to change notification settings - Fork 12
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(javascript): order type first in legacy mapping #695
Conversation
This is based on an assumption, but if I'd implement this endpoint in the search engine, I would shortcut to the facet search as soon as I see `type: facet`, so this has a chance to be imperceptually faster
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
@@ -3,9 +3,9 @@ if (searchMethodParams && Array.isArray(searchMethodParams)) { | |||
requests: searchMethodParams.map(({ params, ...legacyRequest }) => { | |||
if (legacyRequest.type === 'facet') { | |||
return { | |||
type: 'facet', |
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.
Wouldn't the spread would put it later in the object (based on where the user defined it)?
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.
maybe we can extract it from the legacyRequest
, (would also prevent the TS error in the build)
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.
destructuring is also an option, but with the current option it will always be the last parameter. I don't think this can make a big difference anyway, I'll leave it up to you how to solve it @shortcuts :)
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'll open an issue from this PR and come back to tackling it when we have more time!
This is based on an assumption, but if I'd implement this endpoint in the search engine, I would shortcut to the facet search as soon as I see
type: facet
, so this has a chance to be imperceptually faster🧭 What and Why
🎟 JIRA Ticket: /
Changes included:
🧪 Test
Nothing should have changed, except possibly a very small performance improvement