Fixed usermanager ext
This commit is contained in:
parent
6ae3690797
commit
daff019920
|
@ -1,4 +1,5 @@
|
|||
from typing import NamedTuple
|
||||
from sqlite3 import Row
|
||||
|
||||
|
||||
class Users(NamedTuple):
|
||||
|
@ -16,3 +17,7 @@ class Wallets(NamedTuple):
|
|||
user: str
|
||||
adminkey: str
|
||||
inkey: str
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "Wallets":
|
||||
return cls(**dict(row))
|
||||
|
|
|
@ -122,7 +122,15 @@ async def api_usermanager_wallet_transactions(wallet_id):
|
|||
@api_check_wallet_key(key_type="invoice")
|
||||
async def api_usermanager_users_wallets(user_id):
|
||||
wallet = await get_usermanager_users_wallets(user_id)
|
||||
return jsonify(wallet), HTTPStatus.OK
|
||||
return (
|
||||
jsonify(
|
||||
[
|
||||
wallet._asdict()
|
||||
for wallet in await get_usermanager_users_wallets(user_id)
|
||||
]
|
||||
),
|
||||
HTTPStatus.OK,
|
||||
)
|
||||
|
||||
|
||||
@usermanager_ext.route("/api/v1/wallets/<wallet_id>", methods=["DELETE"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user