moved upload route into API namespace

This commit is contained in:
barisusakli
2014-06-30 16:33:10 -04:00
parent b41b311d94
commit b8b6ae7b2f
4 changed files with 18 additions and 24 deletions

View File

@@ -154,13 +154,11 @@ middleware.checkAccountPermissions = function(req, res, next) {
return res.redirect('/login?next=' + req.url);
}
// this function requires userslug to be passed in. todo: /user/uploadpicture should pass in userslug I think
user.getUidByUserslug(req.params.userslug, function (err, uid) {
if (err) {
return next(err);
}
// not sure if this check really should belong here. also make sure we're not doing this check again in the actual method
if (!uid) {
if (res.locals.isAPI) {
return res.json(404, 'not-found');