forked from openlp/openlp
Merge branch 'api-return-on-empty-search' into 'master'
Always return a list when searching in the API Closes web-remote#1 See merge request openlp/openlp!156
This commit is contained in:
commit
4a667c77fc
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_bible():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_views.route('/live', methods=['POST'])
|
||||
|
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_view():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_custom.route('/add', methods=['POST'])
|
||||
|
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_view():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_images.route('/add', methods=['POST'])
|
||||
|
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_view():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_media.route('/add', methods=['POST'])
|
||||
|
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_view():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_presentations.route('/add', methods=['POST'])
|
||||
|
@ -61,9 +61,7 @@ def add(id):
|
||||
def search_view():
|
||||
text = request.args.get('text', '')
|
||||
result = search(text)
|
||||
if result:
|
||||
return jsonify(result)
|
||||
return '', 400
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@v2_songs.route('/add', methods=['POST'])
|
||||
|
Loading…
Reference in New Issue
Block a user