Prepared conversation callback function

This commit is contained in:
Pierre 2017-06-25 16:30:55 +02:00
parent 8764187273
commit fee007d127
2 changed files with 13 additions and 6 deletions

View File

@ -274,10 +274,6 @@ ComunicWeb.components.conversations.interface = {
*/
refreshConversations: function(newConversations, toRefresh, callback){
//DEBUG log informations
console.log("New conversations", newConversations);
console.log("To refresh", toRefresh);
//Perform a request on the API
var apiURI = "conversations/refresh";
var params = {

View File

@ -135,10 +135,21 @@ ComunicWeb.components.conversations.service = {
/**
* Service callback function
*
* @param {Object}
* @param {Object} result The result of the request
* @return {Boolean} True for a success
*/
callback: function(){
callback: function(result){
//Check for errors
if(result.error){
ComunicWeb.debug.logMessage("Conversations Service : Couldn't update conversations !");
//Display a notification
ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to refresh conversations system !", "danger", 1.5);
}
else {
//We can continue with the result
}
//Unlock service
this.__serviceLock = false;