diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index b0544f5..532fe0c 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -2,6 +2,8 @@ import { RequestHandler } from "../entities/RequestHandler"; import { UserHelper } from "../helpers/UserHelper"; import { User, UserPageStatus } from "../entities/User"; import { AccountImage, AccountImageVisibilityLevel } from "../entities/AccountImage"; +import { BackgroundImageHelper } from "../helpers/BackgroundImageHelper"; +import { LikesHelper, LikesType } from "../helpers/LikesHelper"; /** * User information controller @@ -83,7 +85,8 @@ export class UserController { info["noCommentOnHisPage"] = user.blockComments; 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); } return info; diff --git a/src/helpers/BackgroundImageHelper.ts b/src/helpers/BackgroundImageHelper.ts new file mode 100644 index 0000000..8d4614f --- /dev/null +++ b/src/helpers/BackgroundImageHelper.ts @@ -0,0 +1,16 @@ +import { pathUserData } from "../utils/UserDataUtils"; + +/** + * Legacy background image helper + * + * @author Pierre HUBERT + */ + +export class BackgroundImageHelper { + + public static GetURL(userID: number) : string { + // Currently, it is not planned to integrate background image anymore + return pathUserData("imgfond/0.jpg"); + } + +} \ No newline at end of file