mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Fetch likes information
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user