Skip to content

Commit

Permalink
Merge pull request #1219 from Patternslib/autosuggest-optional-index
Browse files Browse the repository at this point in the history
fix(pat-autosuggest): For ajax queries, include the index parameter only if it is set.
  • Loading branch information
thet authored Jan 13, 2025
2 parents 13bf6dc + 85da6a5 commit 8fadfda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pat/auto-suggest/auto-suggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,15 @@ export default Base.extend({
quietMillis: this.options.ajax.timeout,
data: (term, page) => {
const request_data = {
index: this.options.ajax["search-index"],
q: term, // search term
page: page,
};

const index = this.options.ajax["search-index"];
if (index) {
request_data.index = index;
}

const page_limit = this.page_limit(page);
if (page_limit > 0) {
request_data.page_limit = page_limit;
Expand Down

0 comments on commit 8fadfda

Please sign in to comment.