summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/controller/ContentController.js4
-rw-r--r--js/service/UserResource.js3
-rw-r--r--templates/part.content.php2
3 files changed, 6 insertions, 3 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;
diff --git a/templates/part.content.php b/templates/part.content.php
index a21ef3a29..5c9680c1d 100644
--- a/templates/part.content.php
+++ b/templates/part.content.php
@@ -120,7 +120,7 @@
<a ng-repeat="user in Content.userList">
- {{ user }}
+ {{ user.value.shareWith }}
</a>
<p class="label-group">Partage réseaux sociaux</p>