Added ID
This commit is contained in:
parent
7b2b1de681
commit
4c3db72afc
1 changed files with 5 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue