profile: add hasAvatar
This commit is contained in:
@@ -47,9 +47,6 @@ async function canEditProfile(req, res, next) {
|
||||
async function get(req, res, next) {
|
||||
assert.strictEqual(typeof req.user, 'object');
|
||||
|
||||
const [error, backgroundImage] = await safe(users.getBackgroundImage(req.user));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {
|
||||
id: req.user.id,
|
||||
username: req.user.username,
|
||||
@@ -59,7 +56,8 @@ async function get(req, res, next) {
|
||||
twoFactorAuthenticationEnabled: req.user.twoFactorAuthenticationEnabled,
|
||||
role: req.user.role,
|
||||
source: req.user.source,
|
||||
hasBackgroundImage: !!backgroundImage,
|
||||
hasBackgroundImage: req.user.hasBackgroundImage,
|
||||
hasAvatar: req.user.hasAvatar,
|
||||
language: req.user.language || await settings.get(settings.LANGUAGE_KEY),
|
||||
notificationConfig: req.user.notificationConfig,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user