move profile icons into the database
This commit is contained in:
@@ -11,8 +11,6 @@ exports = module.exports = {
|
||||
createInvite,
|
||||
sendInvite,
|
||||
setGroups,
|
||||
setAvatar,
|
||||
clearAvatar,
|
||||
makeOwner,
|
||||
|
||||
disableTwoFactorAuthentication,
|
||||
@@ -210,28 +208,6 @@ function changePassword(req, res, next) {
|
||||
});
|
||||
}
|
||||
|
||||
function setAvatar(req, res, next) {
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
if (!req.files.avatar) return next(new HttpError(400, 'avatar is missing'));
|
||||
|
||||
users.setAvatar(req.resource.id, req.files.avatar.path, function (error) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
});
|
||||
}
|
||||
|
||||
function clearAvatar(req, res, next) {
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
users.clearAvatar(req.resource.id, function (error) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
});
|
||||
}
|
||||
|
||||
// This route transfers ownership from token user to user specified in path param
|
||||
function makeOwner(req, res, next) {
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
Reference in New Issue
Block a user