Fix image

This commit is contained in:
gprunet
2026-01-23 17:04:22 +01:00
parent d1b28549ee
commit 471be08fd7
5 changed files with 16 additions and 6 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+1
View File
@@ -33,6 +33,7 @@ router.delete('/', authenticateToken, async(req, res) =>
router.get('/me', authenticateToken, async(req, res) =>
{
console.log('GET /me hit, user:', req.user);
const result = await avatarService.getAvatarUrl(req.user.userId);
res.status(result.status).json(result.data);
});
+2 -1
View File
@@ -128,7 +128,8 @@ async function getAvatarUrl(userId)
if (result.rows.length === 0)
return ({status: 404, data: {error: 'User not found'}});
return ({status: 200, data: {avatar_url: result.rows[0].avatar_url}});
const avatarUrl = result.rows[0].avatar_url || DEFAULT_AVATAR;
return ({status: 200, data: {avatar_url: avatarUrl}});
}
catch (err)
{