This commit is contained in:
ben
2022-12-14 00:31:09 +00:00
parent 7b2b1de681
commit 4c3db72afc

View File

@@ -3,6 +3,8 @@ from typing import List
from . import db from . import db
from .models import Target from .models import Target
from lnbits.helpers import urlsafe_short_hash
async def get_targets(source_wallet: str) -> List[Target]: async def get_targets(source_wallet: str) -> List[Target]:
rows = await db.fetchall( rows = await db.fetchall(
@@ -20,10 +22,11 @@ async def set_targets(source_wallet: str, targets: List[Target]):
await conn.execute( await conn.execute(
""" """
INSERT INTO splitpayments.targets INSERT INTO splitpayments.targets
(source, wallet, percent, tag, alias) (id, source, wallet, percent, tag, alias)
VALUES (?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?)
""", """,
( (
urlsafe_short_hash(),
source_wallet, source_wallet,
target.wallet, target.wallet,
target.percent, target.percent,