Group share suggestions by userid

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-10-17 21:57:47 +02:00
parent a1c6e44700
commit 06d8438fda
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 7 additions and 1 deletions

View File

@ -312,6 +312,12 @@
var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);
function dynamicSort(property) {
return function (a,b) {
return (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;
}
}
var grouped = suggestions.sort(dynamicSort('uuid'));
var moreResultsAvailable =
(
oc_config['sharing.maxAutocompleteResults'] > 0
@ -328,7 +334,7 @@
)
);
deferred.resolve(suggestions, exactMatches, moreResultsAvailable);
deferred.resolve(grouped, exactMatches, moreResultsAvailable);
} else {
deferred.reject(result.ocs.meta.message);
}