Can respond to membership requests

This commit is contained in:
Pierre HUBERT
2018-07-09 15:41:48 +02:00
parent c9d0a597f5
commit d541506820
3 changed files with 197 additions and 47 deletions

View File

@ -175,6 +175,23 @@ ComunicWeb.components.groups.interface = {
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
},
/**
* Get information about a single user membership
*
* @param {Number} userID The ID of the target user
* @param {Number} groupID The ID of the target group
* @param {Function} callback The result
*/
getMembership: function(userID, groupID, callback){
//Perform the request over the API
var apiURI = "groups/get_membership";
var params = {
groupID: groupID,
userID: userID
};
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
},
/**
* Remove (delete) a member from the group
*
@ -190,5 +207,23 @@ ComunicWeb.components.groups.interface = {
userID: userID
};
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
},
/**
* Respond to a membership request
*
* @param {Number} groupID The ID of the target group
* @param {Number} userID The ID of the target user
* @param {Boolean} accept Specify whether the request is accepted or not
*/
respondRequest: function(groupID, userID, accept, callback){
//Perform the request over the API
var apiURI = "groups/respond_request";
var params = {
groupID: groupID,
userID: userID,
accept: accept
};
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
}
};