summaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-03-21 09:46:52 +0100
committerJoas Schilling <coding@schilljs.com>2018-03-21 09:46:52 +0100
commitdabd7291c35599dd072cc82b93b3f1c2628835a7 (patch)
tree5adbc943aa34191033d9cc0b71d6273e014e1d7f /apps/comments/js
parentc8340ace5c22b3a3cf2132b2efbe91104aab04e9 (diff)
downloadnextcloud-server-dabd7291c35599dd072cc82b93b3f1c2628835a7.tar.gz
nextcloud-server-dabd7291c35599dd072cc82b93b3f1c2628835a7.zip
Make the new autocomplete endpoint OCS
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 9e501b141a7..20f1f590a28 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -240,19 +240,22 @@
if(!_.isUndefined(this._autoCompleteRequestCall)) {
this._autoCompleteRequestCall.abort();
}
- this._autoCompleteRequestCall = $.get(
- OC.generateUrl('/autocomplete/get'),
- {
+ this._autoCompleteRequestCall = $.ajax({
+ url: OC.linkToOCS('core', 2) + 'autocomplete/get',
+ data: {
search: query,
itemType: 'files',
itemId: s.model.get('id'),
sorter: 'commenters|share-recipients',
limit: OC.appConfig.comments.maxAutoCompleteResults
},
- function (data) {
- callback(data);
+ beforeSend: function (request) {
+ request.setRequestHeader('Accept', 'application/json');
+ },
+ success: function (result) {
+ callback(result.ocs.data);
}
- );
+ });
}, 400);
},