-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use the language search profile if available #289
Conversation
237da63
to
95cc5a6
Compare
95cc5a6
to
49a0c3c
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.
LGTM overall
public async searchItems( searchTerm: string, offset?: number ): Promise<SearchedItemOption[]> { | ||
const additionalParams: Record<string, string> = {}; | ||
if ( this.availableSearchProfiles.includes( this.LANGUAGE_PROFILE_NAME ) ) { | ||
additionalParams.profile = this.LANGUAGE_PROFILE_NAME; |
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.
We could also move this into the constructor, right? (And then maybe even discard this.availableSearchProfiles
.)
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.
Not sure if I fully understand what you are suggesting. I adjusted it a bit. 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.
What I had in mind was that even the additionalParams
could be a class member, but I’m also okay with just having the useLanguageProfile
boolean there.
Co-authored-by: Lucas Werkmeister <lucas.werkmeister@wikimedia.de>
Co-authored-by: Lucas Werkmeister <lucas.werkmeister@wikimedia.de>
Bug: T312853