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