mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 00:25:17 +00:00
Can update following status of a frienship
This commit is contained in:
@ -227,6 +227,26 @@ export class FriendsHelper {
|
||||
}) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the following status for a friendship
|
||||
*
|
||||
* @param userID The ID of the user updating the status
|
||||
* @param friendID The ID of the target friend
|
||||
* @param follow New following status
|
||||
*/
|
||||
public static async SetFollowing(userID: number, friendID: number, follow: boolean) {
|
||||
await DatabaseHelper.UpdateRows({
|
||||
table: FRIENDS_TABLE,
|
||||
where: {
|
||||
ID_personne: userID,
|
||||
ID_amis: friendID
|
||||
},
|
||||
set: {
|
||||
abonnement: follow ? 1 : 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a user is following a friend or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user