1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-07-20 00:25:24 +00:00

Can remove a friend from the list

This commit is contained in:
2020-01-01 12:17:24 +01:00
parent eefba81fd3
commit f46d87def5
3 changed files with 35 additions and 0 deletions

@@ -161,6 +161,24 @@ export class FriendsHelper {
});
}
/**
* Destroy a friendship
*
* @param userOne The ID of the first user
* @param userTwo The ID of the second user
*/
public static async RemoveFriendship(userOne: number, userTwo: number) {
await DatabaseHelper.DeleteRows(FRIENDS_TABLE, {
ID_personne: userOne,
ID_amis: userTwo
});
await DatabaseHelper.DeleteRows(FRIENDS_TABLE, {
ID_personne: userTwo,
ID_amis: userOne
});
}
/**
* Count the number of friendship requests a user
* received