mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04:00
Only pass searchContext type, id in search request
This commit is contained in:
parent
b82a5dfd56
commit
afa519b3ae
1 changed files with 7 additions and 1 deletions
|
@ -23,7 +23,13 @@ Discourse.Search = {
|
||||||
// Only include the data we have
|
// Only include the data we have
|
||||||
var data = { term: term }
|
var data = { term: term }
|
||||||
if (opts.typeFilter) data.type_filter = opts.typeFilter;
|
if (opts.typeFilter) data.type_filter = opts.typeFilter;
|
||||||
if (opts.searchContext) data.search_context = opts.searchContext;
|
|
||||||
|
if (opts.searchContext) {
|
||||||
|
data.search_context = {
|
||||||
|
type: opts.searchContext.type,
|
||||||
|
id: opts.searchContext.id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return Discourse.ajax('/search', { data: data });
|
return Discourse.ajax('/search', { data: data });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue