diff --git a/pillar/api/search/routes.py b/pillar/api/search/routes.py index d529b22f..51e871ff 100644 --- a/pillar/api/search/routes.py +++ b/pillar/api/search/routes.py @@ -49,13 +49,12 @@ def search_nodes(): result = queries.do_node_search(searchword, terms, page_idx, project_id) return jsonify(result) -@blueprint_search.route('/multisearch', methods=['GET']) +@blueprint_search.route('/multisearch', methods=['POST']) def multi_search_nodes(): - import json if len(request.args) != 1: log.info(f'Expected 1 argument, received {len(request.args)}') - json_obj = json.loads([a for a in request.args][0]) + json_obj = request.json q = [] for row in json_obj: q.append({ diff --git a/src/scripts/js/es6/common/quicksearch/MultiSearch.js b/src/scripts/js/es6/common/quicksearch/MultiSearch.js index 88747294..457aff72 100644 --- a/src/scripts/js/es6/common/quicksearch/MultiSearch.js +++ b/src/scripts/js/es6/common/quicksearch/MultiSearch.js @@ -44,7 +44,13 @@ export class MultiSearch { thenExecute() { let data = JSON.stringify(this.getAllParams()); - let rawAjax = $.getJSON(this.apiUrl, data); + let rawAjax = $.ajax({ + url: this.apiUrl, + type: 'POST', + data: data, + dataType: 'json', + contentType: 'application/json; charset=UTF-8' + }); let prettyPromise = rawAjax.then(this.parseResult.bind(this)); prettyPromise['abort'] = rawAjax.abort.bind(rawAjax); // Hack to be able to abort the promise down the road return prettyPromise;