mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55: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) {
|
if (!req.params.term) {
|
||||||
return res.render('search', {
|
var results = {
|
||||||
time: 0,
|
time: 0,
|
||||||
search_query: '',
|
search_query: '',
|
||||||
posts: [],
|
posts: [],
|
||||||
@@ -32,7 +32,14 @@ searchController.search = function(req, res, next) {
|
|||||||
tags: [],
|
tags: [],
|
||||||
categories: categories,
|
categories: categories,
|
||||||
breadcrumbs: breadcrumbs
|
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);
|
req.params.term = validator.escape(req.params.term);
|
||||||
|
|||||||
Reference in New Issue
Block a user