fix: returned object

This commit is contained in:
David Arena
2024-12-17 22:25:09 +01:00
parent fc1c3a8f97
commit 9207cf501c
2 changed files with 4 additions and 3 deletions

View File

@@ -619,4 +619,5 @@ class Health(BaseModel):
bot_startup_ts: int | None = None
class ListCustomData(BaseModel):
custom_data: list[dict[str, Any]] | None = None
trade_id: int
custom_data: list[dict[str, Any]]

View File

@@ -535,7 +535,7 @@ def sysinfo():
def health(rpc: RPC = Depends(get_rpc)):
return rpc.health()
@router.get("/trades/{tradeid}/custom_data", response_model=ListCustomData, tags=["info"])
@router.get("/trades/{tradeid}/custom-data", response_model=list[ListCustomData], tags=["info"])
def list_custom_data(trade_id: int, rpc: RPC = Depends(get_rpc)):
custom_data = rpc._rpc_list_custom_data(trade_id)
return ListCustomData(custom_data=custom_data)
return custom_data