Sort the modal data
This commit is contained in:
parent
b5ff784a0e
commit
eb039af9f2
|
@ -23,6 +23,12 @@ def escape(obj):
|
|||
return obj
|
||||
|
||||
|
||||
def sort_data(data):
|
||||
for item in data:
|
||||
if isinstance(data[item], list):
|
||||
data[item].sort()
|
||||
|
||||
|
||||
def threshold_request(url, data):
|
||||
headers = {
|
||||
"ApiKey": settings.THRESHOLD_API_KEY,
|
||||
|
@ -46,6 +52,7 @@ def threshold_request(url, data):
|
|||
response = r.json()
|
||||
except JSONDecodeError:
|
||||
logging.error(f"Invalid JSON response: {r.text}")
|
||||
sort_data(response)
|
||||
return response
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue