1
0
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:
2020-01-01 14:58:31 +01:00
parent f46d87def5
commit 4cfb85d1ad
4 changed files with 52 additions and 1 deletions

View File

@ -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
*