backups: the get route was accidentally removed
This commit is contained in:
@@ -113,13 +113,10 @@ async function getAvatar(req, res, next) {
|
||||
assert.strictEqual(typeof req.resources.user, 'object');
|
||||
assert.strictEqual(typeof req.user, 'object');
|
||||
|
||||
console.log('HERE');
|
||||
const [avatarError, avatar] = await safe(users.getAvatar(req.resources.user));
|
||||
if (avatarError) return next(BoxError.toHttpError(avatarError));
|
||||
if (!avatar) return next(new HttpError(404, 'no avatar'));
|
||||
|
||||
console.log('GETT AVATAR TO', avatar.length, req.resources.user.id);
|
||||
|
||||
res.set('Content-Type', 'image/png');
|
||||
res.status(200).send(avatar);
|
||||
}
|
||||
@@ -133,8 +130,6 @@ async function setAvatar(req, res, next) {
|
||||
safe.fs.unlinkSync(req.files.avatar.path);
|
||||
if (!avatar) return next(BoxError.toHttpError(new BoxError(BoxError.FS_ERROR, safe.error.message)));
|
||||
|
||||
console.log('SETTING AVATAR TO', avatar.length, req.resources.user.id);
|
||||
|
||||
const [error] = await safe(users.setAvatar(req.resources.user, avatar));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user