mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Return dummy background image & likes count
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								src/helpers/BackgroundImageHelper.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/helpers/BackgroundImageHelper.ts
									
									
									
									
									
										Normal file
									
								
							@@ -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");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user