mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 12:20:21 +01:00
added amount to spend
This commit is contained in:
parent
609bdae1e4
commit
dda5784a47
1 changed files with 4 additions and 3 deletions
|
@ -190,11 +190,12 @@ async def get_hits_today(card_id: str) -> Optional[Hit]:
|
||||||
return [Hit(**row) for row in updatedrow]
|
return [Hit(**row) for row in updatedrow]
|
||||||
|
|
||||||
|
|
||||||
async def spend_hit(id: str):
|
async def spend_hit(id: str, amount: int):
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"UPDATE boltcards.hits SET spent = ? WHERE id = ?",
|
"UPDATE boltcards.hits SET spent = ?, amount = ? WHERE id = ?",
|
||||||
(True, id),
|
(True, amount, id),
|
||||||
)
|
)
|
||||||
|
return await get_hit(id)
|
||||||
|
|
||||||
|
|
||||||
async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit:
|
async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit:
|
||||||
|
|
Loading…
Add table
Reference in a new issue