mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-09-20 06:08:46 +00:00
Completed advanced info
This commit is contained in:
@@ -68,7 +68,7 @@ export class UserController {
|
||||
}
|
||||
|
||||
|
||||
private static async UserToAPI(user : User, handler: RequestHandler, advanced: boolean = false) : Promise<Object> {
|
||||
private static async UserToAPI(user : User, h: RequestHandler, advanced: boolean = false) : Promise<Object> {
|
||||
const info = {
|
||||
"userID": user.id,
|
||||
"firstName": user.firstName,
|
||||
@@ -76,7 +76,7 @@ export class UserController {
|
||||
"publicPage": user.pageStatus == UserPageStatus.PUBLIC,
|
||||
"openPage": user.pageStatus == UserPageStatus.OPEN,
|
||||
"virtualDirectory": user.virtualDirectory,
|
||||
"accountImage": this.GetAccountImageURL(user.accountImage, handler)
|
||||
"accountImage": this.GetAccountImageURL(user.accountImage, h)
|
||||
};
|
||||
|
||||
if(advanced) {
|
||||
@@ -87,8 +87,12 @@ export class UserController {
|
||||
info["allowPostFromFriendOnHisPage"] = user.allowPostsFromFriends;
|
||||
info["account_creation_time"] = user.timeCreate;
|
||||
info["backgroundImage"] = BackgroundImageHelper.GetURL(user.id);
|
||||
info["pageLikes"] = await LikesHelper.Count(user.id, LikesType.USER);
|
||||
info["number_friends"] = user.friendsListPublic ? await FriendsHelper.CountForUser(user.id) : 0
|
||||
|
||||
info["pageLikes"] = await LikesHelper.Count(user.id, LikesType.USER);
|
||||
info["user_like_page"] = h.signedIn ? await LikesHelper.IsLiking(h.getUserId(), user.id, LikesType.USER) : false;
|
||||
|
||||
info["can_post_texts"] = await UserHelper.CanCreatePosts(h.getUserId(), user.id);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
Reference in New Issue
Block a user