mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #929 from chrishunt/chrishunt/fix-category-search
Only pass search context type and id in search request
This commit is contained in:
commit
11aad6fe1e
@ -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 New Issue
Block a user