chg: [API json import] take list as imput

This commit is contained in:
Terrtia 2020-04-28 15:02:22 +02:00
parent 8d727cbd31
commit 6f3cb17beb
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -104,6 +104,8 @@ def api_import_json_item(data_json):
return ({'status': 'error', 'reason': 'Malformed JSON'}, 400)
# # TODO: add JSON verification
res = add_json_to_json_queue(data_json)
if not res:
return ({'status': 'success'}, 200)
for item_json in data_json:
res = add_json_to_json_queue(item_json)
if res:
return ({'status': 'error'}, 400)
return ({'status': 'success'}, 200)