Quick Search: Queries containing equal sign (=) failed

This commit is contained in:
Tobias Johansson 2018-11-27 10:00:44 +01:00
parent 1c0476699a
commit 82071bf922
2 changed files with 9 additions and 4 deletions

View File

@ -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({

View File

@ -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;