From 553548b6897f8ef292ab56af9dcc196ef8ee0cb3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 24 Feb 2021 15:07:31 +0300 Subject: request label counters conditionally --- js/Feeds.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'js/Feeds.js') diff --git a/js/Feeds.js b/js/Feeds.js index 5d64b77ee..3767f8b65 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -133,10 +133,15 @@ const Feeds = { this._search_query = ""; this.reloadCurrent(); }, - requestCounters: function(feed_ids = null) { - xhr.json("backend.php", {op: "rpc", method: "getAllCounters", "feed_ids[]": feed_ids, seq: App.next_seq()}, () => { - // - }); + // null = get all data, [] would give empty response for specific type + requestCounters: function(feed_ids = null, label_ids = null) { + xhr.json("backend.php", {op: "rpc", + method: "getAllCounters", + "feed_ids[]": feed_ids, + "feed_id_count": feed_ids ? feed_ids.length : -1, + "label_ids[]": label_ids, + "label_id_count": label_ids ? label_ids.length : -1, + seq: App.next_seq()}); }, reload: function() { try { -- cgit v1.2.3