Commit 9be2a5f6 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_api_style: allDocs no longer accumulate results

* allDocs now behave like others action mode and return the result
of the match
* It allows greater customization of the output data
parent 62e94f42
......@@ -117,10 +117,7 @@ for erp5_action_key in erp5_action_dict.keys():
if mode == "post":
if response.getStatus() == 200:
response.setStatus(201)
# If not search, job is done and we can return result
if mode != "allDocs":
return result
result_list += result
return result
except ValueError as e:
try:
error_dict.update(json.loads(str(e)))
......@@ -143,12 +140,4 @@ if not match:
error_kw["detail_list"] = sorted(error_dict.items())
return logError(error_message, **error_kw)
if mode == "allDocs":
return json.dumps({
"$schema": "alldocs-response-schema.json",
"result_list":result_list
},
indent=2
)
raise ValueError("Unreachable code reached")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment