From 32a1610b5d9484c8db944a41716c4c13174c0ef5 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jul 2015 11:58:42 -0400 Subject: [PATCH] FIX: Search had wrong preload store key --- .../javascripts/discourse/routes/build-topic-route.js.es6 | 3 ++- lib/topic_query.rb | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 index ac1f8a8bbb4..e4e9275ac47 100644 --- a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 @@ -74,9 +74,10 @@ function findTopicList(store, filter, filterParams, extras) { export default function(filter, extras) { extras = extras || {}; return Discourse.Route.extend({ - queryParams: queryParams, + queryParams, beforeModel() { + console.log('before model', filter); this.controllerFor('navigation/default').set('filterMode', filter); }, diff --git a/lib/topic_query.rb b/lib/topic_query.rb index 6bda1c0abc5..958fb6da7da 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -74,7 +74,6 @@ class TopicQuery def list_search results = nil - if @options[:q].present? search = Search.execute(@options[:q], type_filter: 'topic', @@ -106,8 +105,7 @@ class TopicQuery .references('tu') end - list = create_list(:latest, {unordered: true}, results) - + list = create_list(:search, {unordered: true}, results) list.topics.each do |topic| if posts = posts_map[topic.id]