From ea4178620be71ce993144fad600647491ba1b3fb Mon Sep 17 00:00:00 2001 From: "marco.nassabain@etu.unistra.fr" Date: Tue, 12 Jan 2021 23:15:41 +0100 Subject: =?UTF-8?q?=F0=9F=8E=A8=20create=20ShareController=20and=20moved?= =?UTF-8?q?=20share=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- js/controller/ContentController.js | 16 ---------------- js/controller/ShareController.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 js/controller/ShareController.js (limited to 'js') diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js index 1d043945a..457700dca 100644 --- a/js/controller/ContentController.js +++ b/js/controller/ContentController.js @@ -223,20 +223,4 @@ app.controller('ContentController', function (Publisher, FeedResource, ItemResou this.activeItem = this.getFirstItem(); - this.userList = []; - - this.searchUsers = function(search) { - // TODO: search === undefined 🤢 je pense pas que c'est ouf comme syntaxe - if (search === '' || search === undefined) { - this.userList = []; - return; - } - - // TODO: bug - requetes retardataires (regarder issues git) - var response = ShareResource.getUsers(search); - response.then((response) => { - this.userList = response.ocs.data.users; - }); - }; - }); \ No newline at end of file diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js new file mode 100644 index 000000000..4b7f15d0e --- /dev/null +++ b/js/controller/ShareController.js @@ -0,0 +1,28 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Marco Nassabain + */ +app.controller('ShareController', function (ShareResource) { + 'use strict'; + + this.userList = []; + + this.searchUsers = function(search) { + // TODO: search === undefined 🤢 je pense pas que c'est ouf comme syntaxe + if (search === '' || search === undefined) { + this.userList = []; + return; + } + + // TODO: bug - requetes retardataires (regarder issues git) + var response = ShareResource.getUsers(search); + response.then((response) => { + this.userList = response.ocs.data.users; + }); + }; + +}); \ No newline at end of file -- cgit v1.2.3