diff options
author | Joas Schilling <coding@schilljs.com> | 2018-03-21 09:46:52 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-03-21 09:46:52 +0100 |
commit | dabd7291c35599dd072cc82b93b3f1c2628835a7 (patch) | |
tree | 5adbc943aa34191033d9cc0b71d6273e014e1d7f /apps/comments/js | |
parent | c8340ace5c22b3a3cf2132b2efbe91104aab04e9 (diff) | |
download | nextcloud-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.js | 15 |
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); }, |