summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authormarco.nassabain@etu.unistra.fr <marco.nassabain@hotmail.com>2021-01-12 22:56:33 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 23:17:31 +0200
commit4b1102972ebf4d02a4518243e64933767c90e431 (patch)
treed17aac3e5086017444975c9ff8913600e8f703ff /js
parentcf00206da0b95c3c3e51f37982bc7f076e5f4b28 (diff)
🐛 Use the sharee api to get users for sharing
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'js')
-rw-r--r--js/controller/ContentController.js4
-rw-r--r--js/service/UserResource.js3
2 files changed, 5 insertions, 2 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js
index 0def46a15..f4a6981b1 100644
--- a/js/controller/ContentController.js
+++ b/js/controller/ContentController.js
@@ -226,11 +226,13 @@ app.controller('ContentController', function (Publisher, FeedResource, ItemResou
this.userList = [];
this.searchUsers = function(search) {
- if (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 = UserResource.getUsers(search);
response.then((response) => {
this.userList = response.ocs.data.users;
diff --git a/js/service/UserResource.js b/js/service/UserResource.js
index 817c9e9cd..f17335bd3 100644
--- a/js/service/UserResource.js
+++ b/js/service/UserResource.js
@@ -13,8 +13,9 @@ app.factory('UserResource', function (Resource, $http, BASE_URL) {
UserResource.prototype = Object.create(Resource.prototype);
UserResource.prototype.getUsers = function (search) {
+ console.log(search);
return this.http({
- url: OC.linkToOCS(`cloud/users?search=${search}&offset=0&limit=5`, 2),
+ url: OC.linkToOCS(`apps/files_sharing/api/v1/sharees?search=${search}&itemType=file`, 1),
method: 'GET',
}).then(function(response) {
return response.data;