move profile icons into the database

This commit is contained in:
Girish Ramakrishnan
2021-04-29 12:49:48 -07:00
parent 7b8fd3596e
commit b8ea9de439
11 changed files with 117 additions and 82 deletions

View File

@@ -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');