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:
src
@@ -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
|
||||
|
Reference in New Issue
Block a user