mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-18 23:04:20 +01:00
fix: displaying avatar in story comments
This commit is contained in:
@@ -23,12 +23,19 @@ const getEventsExtraData = async (req, res) => {
|
|||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
avatar: true,
|
avatar: true,
|
||||||
|
avatar_rel: {
|
||||||
|
select: {
|
||||||
|
url: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
name: true,
|
name: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
comments.map(c => c.user.avatar = c.user.avatar_rel?.url ?? c.user.avatar)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
.status(200)
|
.status(200)
|
||||||
.json(comments)
|
.json(comments)
|
||||||
|
|||||||
Reference in New Issue
Block a user