Return dict instead of array for clarity

This commit is contained in:
DominikDoom
2023-09-26 12:12:46 +02:00
parent 22365ec8d6
commit ac790c8ede

View File

@@ -594,6 +594,8 @@ def api_tac(_: gr.Blocks, app: FastAPI):
try:
if get:
ret = func()
if ret is list:
ret = [{"name": t[0], "type": t[1], "count": t[2]} for t in ret]
return JSONResponse({"result": ret})
else:
func()