mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-08-19 08:48:23 +02:00
Fix wrong error response from api
This commit is contained in:
parent
383ea5fa31
commit
c39721de96
1 changed files with 2 additions and 2 deletions
|
@ -82,9 +82,9 @@ def get_ip():
|
||||||
def buildResponse(data,httpcode=200 ,error=False):
|
def buildResponse(data,httpcode=200 ,error=False):
|
||||||
"""Builds a JSON response from data."""
|
"""Builds a JSON response from data."""
|
||||||
res={}
|
res={}
|
||||||
if error:
|
|
||||||
res["err"]=error
|
|
||||||
res["result"]=data
|
res["result"]=data
|
||||||
|
if error:
|
||||||
|
res["result"]["err"]=error
|
||||||
|
|
||||||
return jsonify(res), httpcode
|
return jsonify(res), httpcode
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue