1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 08:35:17 +00:00

Can cancel a frienship request

This commit is contained in:
2020-01-01 11:52:34 +01:00
parent f51a20f0e4
commit d8bc8022c0
3 changed files with 37 additions and 0 deletions

View File

@ -114,6 +114,23 @@ export class FriendsHelper {
}) > 0;
}
/**
* Delete a previously sent friendship request
*
* @param userID The ID of the user who have sent the request
* @param targetUser The ID of the target user
*/
public static async RemoveRequest(userID: number, targetUser: number) {
await DatabaseHelper.DeleteRows(
FRIENDS_TABLE,
{
ID_personne: targetUser,
ID_amis: userID,
actif: 0
}
);
}
/**
* Count the number of friendship requests a user
* received