mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
added helpers.redirect
This commit is contained in:
@@ -45,6 +45,14 @@ helpers.notAllowed = function(req, res, error) {
|
||||
}
|
||||
};
|
||||
|
||||
helpers.redirect = function(res, url) {
|
||||
if (res.locals.isAPI) {
|
||||
res.status(302).json(url);
|
||||
} else {
|
||||
res.redirect(url);
|
||||
}
|
||||
};
|
||||
|
||||
helpers.buildCategoryBreadcrumbs = function(cid, callback) {
|
||||
var breadcrumbs = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user