diff --git a/src/controllers/PostsController.ts b/src/controllers/PostsController.ts index ffd4002..2ee9c06 100644 --- a/src/controllers/PostsController.ts +++ b/src/controllers/PostsController.ts @@ -6,6 +6,7 @@ import { MoviesController } from "./MoviesController"; import { MoviesHelper } from "../helpers/MoviesHelper"; import { SurveyHelper } from "../helpers/SurveyHelper"; import { SurveyController } from "./SurveyController"; +import { LikesHelper, LikesType } from "../helpers/LikesHelper"; /** * Posts controller @@ -87,6 +88,11 @@ export class PostsController { // Survey specific data_survey: !p.hasSurvey ? null : await SurveyController.SurveyToAPI(h, await SurveyHelper.GetInfo(p.id)), + + + // Likes information + likes: await LikesHelper.Count(p.id, LikesType.POST), + userlike: h.signedIn ? await LikesHelper.IsLiking(h.getUserId(), p.id, LikesType.POST) : false, }; return data;