diff --git a/backend/src/routes/matches.js b/backend/src/routes/matches.js index 7f1f60c..5765331 100644 --- a/backend/src/routes/matches.js +++ b/backend/src/routes/matches.js @@ -529,10 +529,13 @@ router.get('/:slug/messages', authenticate, async (req, res, next) => { id: msg.id, roomId: msg.roomId, userId: msg.user.id, - username: msg.user.username, - avatar: msg.user.avatar, - firstName: msg.user.firstName, - lastName: msg.user.lastName, + user: { + id: msg.user.id, + username: msg.user.username, + avatar: msg.user.avatar, + firstName: msg.user.firstName, + lastName: msg.user.lastName, + }, content: msg.content, type: msg.type, createdAt: msg.createdAt,