mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 16:45:16 +00:00
Export information about related users
This commit is contained in:
@ -231,7 +231,7 @@ export class AccountController {
|
||||
// Query the database
|
||||
const data = await AccountHelper.Export(h.getUserId());
|
||||
|
||||
const out: any = {
|
||||
const out = {
|
||||
userID: data.userID,
|
||||
|
||||
// General account information
|
||||
@ -262,7 +262,10 @@ export class AccountController {
|
||||
conversation_messages: {},
|
||||
|
||||
// Friends list
|
||||
friends_list: data.friendsList.map(f => FriendsController.FriendToAPI(f, false))
|
||||
friends_list: data.friendsList.map(f => FriendsController.FriendToAPI(f, false)),
|
||||
|
||||
// Related users info
|
||||
users_info: new Map<number, any>(),
|
||||
};
|
||||
|
||||
// Fill conversation messages entry
|
||||
@ -272,7 +275,10 @@ export class AccountController {
|
||||
}
|
||||
|
||||
|
||||
// TODO : continue (additional user info)
|
||||
// Load related users info
|
||||
for(const id of await data.getRelatedUsersID()) {
|
||||
out.users_info[id] = await UserController.UserToAPI(await UserHelper.GetUserInfo(id), h, false);
|
||||
}
|
||||
|
||||
|
||||
h.send(out);
|
||||
|
Reference in New Issue
Block a user