diff --git a/ckanext/odsh/fanstatic/autocomplete.js b/ckanext/odsh/fanstatic/autocomplete.js index 3cd334c3c427cd4d9bbdab4100cf9f9cedc00e66..282b4844d0f3fe49af34f197abfcafdab8965049 100644 --- a/ckanext/odsh/fanstatic/autocomplete.js +++ b/ckanext/odsh/fanstatic/autocomplete.js @@ -9,8 +9,8 @@ $(function () { html: true, minLength: 2, source: function (request, response) { - var url = ckan.SITE_ROOT + '/autocomplete'; - $.getJSON(url, {q: request.term}) + var url = ckan.SITE_ROOT + '/autocomplete/' + request.term; + $.getJSON(url) .done(function (data) { console.log(data); response(data['result']); diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index bb777f65261353b60bdf0ed00b3281ef3980bba3..4aa8b21048e5b87f83d0e5a21bb44f2731d1decd 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -89,7 +89,7 @@ class OdshAutocompletePlugin(plugins.SingletonPlugin): def before_map(self, map): controller = 'ckanext.odsh.controller:OdshAutocompleteController' - map.connect('/autocomplete?q={q}', controller=controller, action='autocomplete') + map.connect('/autocomplete/{q}', controller=controller, action='autocomplete') return map