From c39721de96b5ea527641f2f412106df8f1cedaff Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 18 Aug 2024 20:59:23 +0330 Subject: [PATCH] Fix wrong error response from api --- py/libs/webutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/libs/webutil.py b/py/libs/webutil.py index 50441bf..e435a34 100644 --- a/py/libs/webutil.py +++ b/py/libs/webutil.py @@ -82,9 +82,9 @@ def get_ip(): def buildResponse(data,httpcode=200 ,error=False): """Builds a JSON response from data.""" res={} - if error: - res["err"]=error res["result"]=data + if error: + res["result"]["err"]=error return jsonify(res), httpcode # --------------------------------------------------------------------------