fix(api): add nested user object to match messages response

This commit is contained in:
Radosław Gierwiało
2025-12-07 19:33:31 +01:00
parent c8de07aadb
commit 19700ff67f

View File

@@ -529,10 +529,13 @@ router.get('/:slug/messages', authenticate, async (req, res, next) => {
id: msg.id, id: msg.id,
roomId: msg.roomId, roomId: msg.roomId,
userId: msg.user.id, userId: msg.user.id,
user: {
id: msg.user.id,
username: msg.user.username, username: msg.user.username,
avatar: msg.user.avatar, avatar: msg.user.avatar,
firstName: msg.user.firstName, firstName: msg.user.firstName,
lastName: msg.user.lastName, lastName: msg.user.lastName,
},
content: msg.content, content: msg.content,
type: msg.type, type: msg.type,
createdAt: msg.createdAt, createdAt: msg.createdAt,