From 844c3f7e827ad3d9fd7e0e965bbd8ac3d466c56a Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 17 Jun 2017 17:32:21 +0200 Subject: [PATCH] Declared update settings function --- .../js/components/conversations/chatWindows.js | 5 ++++- assets/js/components/conversations/interface.js | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index b595b0ba..27485e23 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -247,10 +247,10 @@ ComunicWeb.components.conversations.chatWindows = { * @return {Boolean} True for a success */ submitUpdateForm: function(conversation){ - console.log(conversation); //Then, get informations about the input var newValues = { + conversationID: conversation.infos.ID, following: conversation.settingsForm.followConversationInput.checked, } @@ -276,6 +276,9 @@ ComunicWeb.components.conversations.chatWindows = { conversation.settingsForm.createButton.disabled = "true"; //Peform a request through the interface + ComunicWeb.components.conversations.interface.updateSettings(newValues, function(result){ + console.log("Function callback !!!!!!!!!!!!!!", result); + }); //Success return true; diff --git a/assets/js/components/conversations/interface.js b/assets/js/components/conversations/interface.js index 2e75441e..55f3155f 100644 --- a/assets/js/components/conversations/interface.js +++ b/assets/js/components/conversations/interface.js @@ -66,7 +66,7 @@ ComunicWeb.components.conversations.interface = { * * @param {Object} infos Informations about the conversation to create * * @info {Array} users A list of the members of the conversation - * * @info {Boolan} follow Defines if the current user wants to follow the conversation or not + * * @info {Boolean} follow Defines if the current user wants to follow the conversation or not * * @info {Mixed} conversationName The name of the conversation * @param {Function} afterCreate What to do once the conversation is created * @return {Boolean} True for a success @@ -99,6 +99,21 @@ ComunicWeb.components.conversations.interface = { return true; }, + /** + * Update conversation settings + * + * @param {infos} infos Informations about the conversation to update + * @info {Integer} conversationID The ID of the conversation to update + * @info {Boolean} following Specify if the user is following the conversation or not + * @info {String} name Specify a new name for the conversation + * @info {array} members Specify the new list of members for the conversation + * @param {function} callback The function callback + * @return {Boolean} True for a success + */ + updateSettings: function(infos, callback){ + console.log("PLEASE IMPLEMENT ME ON NEXT DEVELOPPEMENT FUNCTION"); + }, + /** * Get informations about a unique conversation *