fix: update_payment should return the updated payment (#3983)

This commit is contained in:
dni ⚡
2026-05-25 14:29:39 +03:00
committed by GitHub
parent d01e3523d8
commit 190a466c0a
2 changed files with 11 additions and 8 deletions
+3 -1
View File
@@ -321,13 +321,15 @@ async def update_payment(
payment: Payment,
new_checking_id: str | None = None,
conn: Connection | None = None,
) -> None:
) -> Payment:
payment.updated_at = datetime.now(timezone.utc)
await (conn or db).update(
"apipayments", payment, "WHERE checking_id = :checking_id"
)
if new_checking_id and new_checking_id != payment.checking_id:
await update_payment_checking_id(payment.checking_id, new_checking_id, conn)
payment.checking_id = new_checking_id
return payment
async def get_payments_history(