mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
added a check for res.locals.isAPI inside res.render, instead of doing it all over the place in code
This commit is contained in:
@@ -80,11 +80,7 @@ Controllers.home = function(req, res, next) {
|
||||
});
|
||||
}
|
||||
}, function (err, data) {
|
||||
if (res.locals.isAPI) {
|
||||
res.json(data);
|
||||
} else {
|
||||
res.render('home', data);
|
||||
}
|
||||
res.render('home', data);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user