From e8df43351fb862ba8a78a56ab4fb3476f39b214c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 2 Sep 2018 14:14:10 +0200 Subject: [PATCH] Can force the request to get multiple groups. --- assets/js/common/shorcuts.js | 5 +++-- assets/js/components/groups/info.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/js/common/shorcuts.js b/assets/js/common/shorcuts.js index fe00b3dc..a6feeabd 100644 --- a/assets/js/common/shorcuts.js +++ b/assets/js/common/shorcuts.js @@ -167,7 +167,8 @@ function getInfoGroup(id, callback){ * * @param {Array} IDs The IDs of the groups to get information about * @param {Function} callback Callback to call once we have information about the group + * @param {Boolean} force TRUE to force the request (ignore cache) */ -function getInfoMultipleGroups(IDs, callback){ - ComunicWeb.components.groups.info.getInfoMultiple(IDs, callback); +function getInfoMultipleGroups(IDs, callback, force){ + ComunicWeb.components.groups.info.getInfoMultiple(IDs, callback, force); } \ No newline at end of file diff --git a/assets/js/components/groups/info.js b/assets/js/components/groups/info.js index deb3d9ca..1d671232 100644 --- a/assets/js/components/groups/info.js +++ b/assets/js/components/groups/info.js @@ -44,14 +44,15 @@ ComunicWeb.components.groups.info = { * * @param {Array} list The list of the IDs of the group to get information about * @param {Function} callback + * @param {Boolean} force TRUE to ignore cache (FALSE by default) */ - getInfoMultiple: function(list, callback){ + getInfoMultiple: function(list, callback, force){ //First, check which group are unknown in the cache var toFetch = Array(); list.forEach(function(id){ - if(!ComunicWeb.components.groups.info._cache[id]) + if(!ComunicWeb.components.groups.info._cache[id] || force) toFetch.push(id); });