mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
fire filter:serch.build if query is empty
This commit is contained in:
@@ -24,7 +24,7 @@ searchController.search = function(req, res, next) {
|
||||
}
|
||||
|
||||
if (!req.params.term) {
|
||||
return res.render('search', {
|
||||
var results = {
|
||||
time: 0,
|
||||
search_query: '',
|
||||
posts: [],
|
||||
@@ -32,7 +32,14 @@ searchController.search = function(req, res, next) {
|
||||
tags: [],
|
||||
categories: categories,
|
||||
breadcrumbs: breadcrumbs
|
||||
};
|
||||
plugins.fireHook('filter:search.build', {data: {}, results: results}, function(err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
res.render('search', data.results);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
req.params.term = validator.escape(req.params.term);
|
||||
|
||||
Reference in New Issue
Block a user