fix: displaying avatar in story comments

This commit is contained in:
Dolu
2022-09-20 09:59:45 +02:00
parent 7876f358e2
commit 00ede216bb

View File

@@ -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)