mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Can create friendship relations
This commit is contained in:
@ -90,6 +90,48 @@ ComunicWeb.components.friends.list = {
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Send (create) a friendship request
|
||||
*
|
||||
* @param {Integer} friendID The friend ID to respond
|
||||
* @param {Function} afterResponse Specify an action to do next
|
||||
* @return {Boolean} True for a success
|
||||
*/
|
||||
sendRequest: function(friendID, afterResponse){
|
||||
//Prepare the API request
|
||||
var apiURI = "friends/sendRequest"
|
||||
var params = {
|
||||
"friendID": friendID,
|
||||
};
|
||||
|
||||
//Process request
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, afterResponse);
|
||||
|
||||
//Success
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove (ancel) a friendship request
|
||||
*
|
||||
* @param {Integer} friendID The target friendID
|
||||
* @param {Function} afterResponse Specify an action to do next
|
||||
* @return {Boolean} True for a success
|
||||
*/
|
||||
removeRequest: function(friendID, afterResponse){
|
||||
//Prepare the API request
|
||||
var apiURI = "friends/removeRequest"
|
||||
var params = {
|
||||
"friendID": friendID,
|
||||
};
|
||||
|
||||
//Process request
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, afterResponse);
|
||||
|
||||
//Success
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the current status of a friendship relation
|
||||
*
|
||||
|
Reference in New Issue
Block a user