mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 01:26:16 +01:00
optimized widget call by bundling all queries into one for #1428; fixes active users widget crash
also fixes b3819fd076 properly
This commit is contained in:
@@ -81,10 +81,15 @@ apiController.getConfig = function(req, res, next) {
|
||||
apiController.renderWidgets = function(req, res, next) {
|
||||
var uid = req.user ? req.user.uid : 0,
|
||||
area = {
|
||||
template: req.params.template + '.tpl',
|
||||
location: req.params.location
|
||||
template: req.query.template,
|
||||
location: req.query.location,
|
||||
url: req.query.url
|
||||
};
|
||||
|
||||
if (!area.template || !area.location) {
|
||||
return res.json(200, {});
|
||||
}
|
||||
|
||||
widgets.render(uid, area, function(err, data) {
|
||||
res.json(200, data);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user