user deletion #746

user deletion NOT SKALABLE
This commit is contained in:
barisusakli
2014-03-14 19:07:50 -04:00
parent a0e784a612
commit 1354739d19
12 changed files with 435 additions and 67 deletions

View File

@@ -145,9 +145,9 @@ topicsController.get = function(req, res, next) {
], function (err, data) {
if (err) {
if (err.message === 'not-enough-privileges') {
return res.redirect('403');
return res.locals.isAPI ? res.json(403, err.message) : res.redirect('403');
} else {
return res.redirect('404');
return res.locals.isAPI ? res.json(404, 'not-found') : res.redirect('404');
}
}
@@ -170,7 +170,7 @@ topicsController.get = function(req, res, next) {
// Paginator for noscript
data.pages = [];
for(var x=1;x<=data.pageCount;x++) {
for(var x=1; x<=data.pageCount; x++) {
data.pages.push({
page: x,
active: x === parseInt(page, 10)