Can create friendship relations

This commit is contained in:
Pierre
2017-12-23 09:14:34 +01:00
parent fe71d9839c
commit e89ae955c2
2 changed files with 86 additions and 4 deletions

View File

@ -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
*