Skip to content

Commit 8fadfda

Browse files
authored
Merge pull request #1219 from Patternslib/autosuggest-optional-index
fix(pat-autosuggest): For ajax queries, include the index parameter only if it is set.
2 parents 13bf6dc + 85da6a5 commit 8fadfda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/pat/auto-suggest/auto-suggest.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,15 @@ export default Base.extend({
260260
quietMillis: this.options.ajax.timeout,
261261
data: (term, page) => {
262262
const request_data = {
263-
index: this.options.ajax["search-index"],
264263
q: term, // search term
265264
page: page,
266265
};
267266

267+
const index = this.options.ajax["search-index"];
268+
if (index) {
269+
request_data.index = index;
270+
}
271+
268272
const page_limit = this.page_limit(page);
269273
if (page_limit > 0) {
270274
request_data.page_limit = page_limit;

0 commit comments

Comments
 (0)