Make the new autocomplete endpoint OCS
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c8340ace5c
commit
dabd7291c3
|
@ -240,19 +240,22 @@
|
||||||
if(!_.isUndefined(this._autoCompleteRequestCall)) {
|
if(!_.isUndefined(this._autoCompleteRequestCall)) {
|
||||||
this._autoCompleteRequestCall.abort();
|
this._autoCompleteRequestCall.abort();
|
||||||
}
|
}
|
||||||
this._autoCompleteRequestCall = $.get(
|
this._autoCompleteRequestCall = $.ajax({
|
||||||
OC.generateUrl('/autocomplete/get'),
|
url: OC.linkToOCS('core', 2) + 'autocomplete/get',
|
||||||
{
|
data: {
|
||||||
search: query,
|
search: query,
|
||||||
itemType: 'files',
|
itemType: 'files',
|
||||||
itemId: s.model.get('id'),
|
itemId: s.model.get('id'),
|
||||||
sorter: 'commenters|share-recipients',
|
sorter: 'commenters|share-recipients',
|
||||||
limit: OC.appConfig.comments.maxAutoCompleteResults
|
limit: OC.appConfig.comments.maxAutoCompleteResults
|
||||||
},
|
},
|
||||||
function (data) {
|
beforeSend: function (request) {
|
||||||
callback(data);
|
request.setRequestHeader('Accept', 'application/json');
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
callback(result.ocs.data);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}, 400);
|
}, 400);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
namespace OC\Core\Controller;
|
namespace OC\Core\Controller;
|
||||||
|
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\OCSController as Controller;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
use OCP\Collaboration\AutoComplete\IManager;
|
use OCP\Collaboration\AutoComplete\IManager;
|
||||||
use OCP\Collaboration\Collaborators\ISearch;
|
use OCP\Collaboration\Collaborators\ISearch;
|
||||||
|
|
|
@ -64,7 +64,6 @@ $application->registerRoutes($this, [
|
||||||
['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'],
|
['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'],
|
||||||
['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'],
|
['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'],
|
||||||
['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'],
|
['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'],
|
||||||
['name' => 'AutoComplete#get', 'url' => 'autocomplete/get', 'verb' => 'GET'],
|
|
||||||
['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'],
|
['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'],
|
||||||
['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'],
|
['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'],
|
||||||
],
|
],
|
||||||
|
@ -75,6 +74,7 @@ $application->registerRoutes($this, [
|
||||||
['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'],
|
['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'],
|
||||||
['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'],
|
['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'],
|
||||||
['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'],
|
['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'],
|
||||||
|
['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue