mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 00:25:17 +00:00
Export groups memberships
This commit is contained in:
@ -13,6 +13,8 @@ import { SurveyController } from "./SurveyController";
|
||||
import { MoviesController } from "./MoviesController";
|
||||
import { ConversationsController } from "./ConversationsController";
|
||||
import { FriendsController } from "./FriendsController";
|
||||
import { GroupsHelper } from "../helpers/GroupsHelper";
|
||||
import { GroupsController } from "./GroupsController";
|
||||
|
||||
/**
|
||||
* Account controller
|
||||
@ -264,6 +266,10 @@ export class AccountController {
|
||||
// Friends list
|
||||
friends_list: data.friendsList.map(f => FriendsController.FriendToAPI(f, false)),
|
||||
|
||||
// Groups membership
|
||||
groups: await Promise.all((await Promise.all(data.groups.map(id => GroupsHelper.GetInfo(id))))
|
||||
.map(info => GroupsController.GroupInfoToAPI(info, h, false))),
|
||||
|
||||
// Related users info
|
||||
users_info: new Map<number, any>(),
|
||||
};
|
||||
|
@ -583,7 +583,7 @@ export class GroupsController {
|
||||
* in the request or not
|
||||
* @returns Generated object
|
||||
*/
|
||||
private static async GroupInfoToAPI(info: GroupInfo, h: RequestHandler, advanced: boolean = false) : Promise<any> {
|
||||
public static async GroupInfoToAPI(info: GroupInfo, h: RequestHandler, advanced: boolean = false) : Promise<any> {
|
||||
|
||||
const membership = await GroupsHelper.GetMembershipInfo(info.id, h.optionnalUserID)
|
||||
|
||||
|
Reference in New Issue
Block a user