Ask to include groups posts in latest posts thread.

This commit is contained in:
Pierre HUBERT 2018-07-20 15:17:26 +02:00
parent 476f1b24a7
commit 547daf4741
2 changed files with 6 additions and 3 deletions

View File

@ -60,9 +60,11 @@ ComunicWeb.components.posts.interface = {
* Get the list of the latest posts * Get the list of the latest posts
* *
* @param {number} lastPostID The ID of the loast loaded post (or 0) * @param {number} lastPostID The ID of the loast loaded post (or 0)
* @param {boolean} include_groups Specify whether groups posts should be
* included or not
* @param {function} callback What to do when we got response * @param {function} callback What to do when we got response
*/ */
get_latest: function(lastPostID, callback){ get_latest: function(lastPostID, include_groups, callback){
if(lastPostID > 0) if(lastPostID > 0)
lastPostID--; lastPostID--;
@ -70,7 +72,8 @@ ComunicWeb.components.posts.interface = {
//Prepare API request //Prepare API request
var APIuri = "posts/get_latest"; var APIuri = "posts/get_latest";
var params = { var params = {
startFrom: lastPostID startFrom: lastPostID,
include_groups: include_groups
}; };
//Perform the request //Perform the request

View File

@ -92,7 +92,7 @@ ComunicWeb.pages.latestPosts.main = {
_load_list: function(target){ _load_list: function(target){
//Perform a request on the server to get the list of latest posts //Perform a request on the server to get the list of latest posts
ComunicWeb.components.posts.interface.get_latest(this._last_post_id, function(response){ ComunicWeb.components.posts.interface.get_latest(this._last_post_id, true, function(response){
//Check for errors - display a modal //Check for errors - display a modal
if(response.error){ if(response.error){