From 65fe5f9736c9353047a4211fdc232d6cb97746ec Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 21 Feb 2018 16:20:52 +0100 Subject: [PATCH] New method in interface to optimize requests. --- assets/js/components/notifications/interface.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/assets/js/components/notifications/interface.js b/assets/js/components/notifications/interface.js index ab774b46..36fad4b9 100644 --- a/assets/js/components/notifications/interface.js +++ b/assets/js/components/notifications/interface.js @@ -22,6 +22,22 @@ ComunicWeb.components.notifications.interface = { }, + /** + * Get the number of unread news such as notifications or conversations + * + * @param {function} callback + */ + getAllUnread: function(callback){ + + //Perform API request + var apiURI = "notifications/count_all_news"; + var params = {}; + + //Perform the request + ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback); + + } + /** * Get the list of unread notifications *