mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-10 04:22:35 +02:00
Added ID
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user