Display the posts of a group

This commit is contained in:
Pierre HUBERT
2018-07-17 09:23:44 +02:00
parent 2032017b0c
commit 74e06a2b89
6 changed files with 164 additions and 0 deletions

View File

@ -31,6 +31,31 @@ ComunicWeb.components.posts.interface = {
},
/**
* Get a group posts
*
* @param {number} groupID The ID of the target group
* @param {int} lastPostID The ID of the last post loaded
* @param {function} callback
*/
get_group: function(groupID, lastPostID, callback){
//Load the previous posts to the loaded post if required
if(lastPostID > 0)
lastPostID--;
//Prepare the API request
var APIuri = "posts/get_group";
var params = {
groupID: groupID,
startFrom: lastPostID
};
//Make the request
ComunicWeb.common.api.makeAPIrequest(APIuri, params, true, callback);
},
/**
* Get the list of the latest posts
*