mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-27 22:18:52 +00:00
Avoid a lot of database requests
This commit is contained in:
parent
25f25815f5
commit
969c644aad
@ -163,7 +163,7 @@ export class CommentsController {
|
||||
// Check if we have to load like information
|
||||
if(!assumeNoLike) {
|
||||
data.likes = await LikesHelper.Count(c.id, LikesType.COMMENT);
|
||||
data.userlike = h.signedIn ? await LikesHelper.IsLiking(h.getUserId(), c.id, LikesType.COMMENT) : false;
|
||||
data.userlike = data.likes > 0 && h.signedIn ? await LikesHelper.IsLiking(h.getUserId(), c.id, LikesType.COMMENT) : false;
|
||||
}
|
||||
|
||||
return data;
|
||||
|
Loading…
Reference in New Issue
Block a user