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

Send (create) a friendship request

This commit is contained in:
2019-12-31 10:47:55 +01:00
parent ca2e106852
commit fed23994fa
3 changed files with 46 additions and 0 deletions

View File

@ -80,6 +80,23 @@ export class FriendsHelper {
return this.DbToFriend(result);
}
/**
* Send (create) a new membership request
*
* @param userID The user sending the request
* @param targetUser The ID of the target user
*/
public static async SendRequest(userID: number, targetUser: number) {
await DatabaseHelper.InsertRow(
FRIENDS_TABLE,
{
ID_personne: targetUser,
ID_amis: userID,
actif: 0
}
);
}
/**
* Check out whether a user sent a request to another friend
*