mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 08:35:17 +00:00
Return the number of friends of the user
This commit is contained in:
@ -26,6 +26,21 @@ export class FriendsHelper {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of friends of a specific user
|
||||
*
|
||||
* @param userID Target user ID
|
||||
*/
|
||||
public static async CountForUser(userID: number) : Promise<number> {
|
||||
return await DatabaseHelper.Count({
|
||||
table: FRIENDS_TABLE,
|
||||
where: {
|
||||
ID_amis: userID,
|
||||
actif: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out whether two users are friend or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user