allow wallet rename issue #141

This commit is contained in:
Tiago vasconcelos
2021-08-06 12:37:30 -03:00
committed by fiatjaf
parent 16f8071731
commit b3856d5aff
4 changed files with 76 additions and 3 deletions
+13 -1
View File
@@ -112,6 +112,18 @@ async def create_wallet(
return new_wallet
async def update_wallet(
wallet_id: str, new_name: str, conn: Optional[Connection] = None
) -> Optional[Wallet]:
await (conn or db).execute(
"""
UPDATE wallets SET
name = ?
WHERE id = ?
""",
(new_name, wallet_id)
)
async def delete_wallet(
*, user_id: str, wallet_id: str, conn: Optional[Connection] = None
@@ -390,7 +402,7 @@ async def check_internal(
row = await (conn or db).fetchone(
"""
SELECT checking_id FROM apipayments
WHERE hash = ? AND pending AND amount > 0
WHERE hash = ? AND pending AND amount > 0
""",
(payment_hash,),
)