1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 08:35:17 +00:00

Return the number of likes of a group

This commit is contained in:
2019-12-25 15:22:43 +01:00
parent f06f772420
commit 91f0413963
2 changed files with 54 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { GroupsHelper } from "../helpers/GroupsHelper";
import { GroupsAccessLevel, GroupInfo, GroupVisibilityLevel, GroupPostsCreationLevel, GroupRegistrationLevel } from "../entities/Group";
import { GroupMembershipLevels } from "../entities/GroupMember";
import { time } from "../utils/DateUtils";
import { LikesHelper, LikesType } from "../helpers/LikesHelper";
/**
* Groups API controller
@ -160,7 +161,7 @@ export class GroupsController {
data["description"] = info.hasDescription ? info.description : "null";
data["url"] = info.url ? info.hasURL : "null";
//TODO : add likes information
data["number_likes"] = await LikesHelper.Count(info.id, LikesType.GROUP);
}
return data;