FIX: Search had wrong preload store key

This commit is contained in:
Robin Ward 2015-07-14 11:58:42 -04:00
parent 46b61627cd
commit 32a1610b5d
2 changed files with 3 additions and 4 deletions

View File

@ -74,9 +74,10 @@ function findTopicList(store, filter, filterParams, extras) {
export default function(filter, extras) { export default function(filter, extras) {
extras = extras || {}; extras = extras || {};
return Discourse.Route.extend({ return Discourse.Route.extend({
queryParams: queryParams, queryParams,
beforeModel() { beforeModel() {
console.log('before model', filter);
this.controllerFor('navigation/default').set('filterMode', filter); this.controllerFor('navigation/default').set('filterMode', filter);
}, },

View File

@ -74,7 +74,6 @@ class TopicQuery
def list_search def list_search
results = nil results = nil
if @options[:q].present? if @options[:q].present?
search = Search.execute(@options[:q], search = Search.execute(@options[:q],
type_filter: 'topic', type_filter: 'topic',
@ -106,8 +105,7 @@ class TopicQuery
.references('tu') .references('tu')
end end
list = create_list(:latest, {unordered: true}, results) list = create_list(:search, {unordered: true}, results)
list.topics.each do |topic| list.topics.each do |topic|
if posts = posts_map[topic.id] if posts = posts_map[topic.id]