backups: the get route was accidentally removed

This commit is contained in:
Girish Ramakrishnan
2025-07-25 11:49:13 +02:00
parent 3f07bb5c3a
commit 59aaabecc7
7 changed files with 30 additions and 18 deletions
-5
View File
@@ -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));