fix(api): add nested user object to match messages response
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user