mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Can check following status of a friend
This commit is contained in:
parent
2152511843
commit
a78510d426
@ -128,6 +128,24 @@ export class FriendsHelper {
|
|||||||
}) > 0;
|
}) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether a user is following a friend or not
|
||||||
|
*
|
||||||
|
* @param userID The ID of the user supposed to following a friend
|
||||||
|
* @param friendID The target friend
|
||||||
|
*/
|
||||||
|
public static async IsFollowing(userID: number, friendID: number) : Promise<boolean> {
|
||||||
|
return await DatabaseHelper.Count({
|
||||||
|
table: FRIENDS_TABLE,
|
||||||
|
where: {
|
||||||
|
ID_personne: userID,
|
||||||
|
ID_amis: friendID,
|
||||||
|
actif: 1,
|
||||||
|
abonnement: 1
|
||||||
|
}
|
||||||
|
}) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check out whether friendship allows to create posts or not
|
* Check out whether friendship allows to create posts or not
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user