mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 02:01:35 +02:00
remove core db action from extension
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
from typing import List, Optional, Union
|
from typing import List, Optional, Union
|
||||||
|
|
||||||
from lnbits.core.models import Payment
|
|
||||||
from lnbits.helpers import urlsafe_short_hash
|
from lnbits.helpers import urlsafe_short_hash
|
||||||
|
|
||||||
from . import db
|
from . import db
|
||||||
@ -48,18 +47,3 @@ async def get_tposs(wallet_ids: Union[str, List[str]]) -> List[TPoS]:
|
|||||||
|
|
||||||
async def delete_tpos(tpos_id: str) -> None:
|
async def delete_tpos(tpos_id: str) -> None:
|
||||||
await db.execute("DELETE FROM tpos.tposs WHERE id = ?", (tpos_id,))
|
await db.execute("DELETE FROM tpos.tposs WHERE id = ?", (tpos_id,))
|
||||||
|
|
||||||
|
|
||||||
async def get_tpos_payments(tpos_id: str, limit: int = 5):
|
|
||||||
|
|
||||||
rows = await db.fetchall(
|
|
||||||
f"""
|
|
||||||
SELECT * FROM apipayments
|
|
||||||
WHERE pending = 'false'
|
|
||||||
AND extra LIKE '%tposId%'
|
|
||||||
AND extra LIKE '%{tpos_id}%'
|
|
||||||
ORDER BY time DESC LIMIT {limit}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return [Payment.from_row(row) for row in rows]
|
|
||||||
|
Reference in New Issue
Block a user