fix missing number on model

This commit is contained in:
Tiago vasconcelos 2021-11-08 15:55:23 +00:00
parent 68dd95dc59
commit 084ecb1c08

View File

@ -56,7 +56,10 @@ async def get_withdraw_link(link_id: str, num=0) -> Optional[WithdrawLink]:
if not row:
return None
return WithdrawLink(**row) if row else None
link = dict(**row)
link["number"] = num
return WithdrawLink.parse_obj(link)
async def get_withdraw_link_by_hash(unique_hash: str, num=0) -> Optional[WithdrawLink]:
@ -65,7 +68,11 @@ async def get_withdraw_link_by_hash(unique_hash: str, num=0) -> Optional[Withdra
)
if not row:
return None
return WithdrawLink(**row) if row else None
link = dict(**row)
link["number"] = num
return WithdrawLink.parse_obj(link)
async def get_withdraw_links(wallet_ids: Union[str, List[str]]) -> List[WithdrawLink]: