added helpers.redirect

This commit is contained in:
barisusakli
2015-03-09 18:22:44 -04:00
parent f0ad2020df
commit ddd4680ea7
6 changed files with 43 additions and 47 deletions

View File

@@ -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 = [];