fix: update link
This commit is contained in:
parent
adf5faa6bf
commit
c0e85cb0a7
1 changed files with 5 additions and 1 deletions
|
|
@ -3,10 +3,10 @@ from http import HTTPStatus
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request
|
from fastapi import APIRouter, Depends, HTTPException, Query, Request
|
||||||
|
|
||||||
from lnbits.core.crud import get_user
|
from lnbits.core.crud import get_user
|
||||||
from lnbits.core.models import WalletTypeInfo
|
from lnbits.core.models import WalletTypeInfo
|
||||||
from lnbits.decorators import require_admin_key, require_invoice_key
|
from lnbits.decorators import require_admin_key, require_invoice_key
|
||||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl
|
|
||||||
|
|
||||||
from .crud import (
|
from .crud import (
|
||||||
create_withdraw_link,
|
create_withdraw_link,
|
||||||
|
|
@ -134,6 +134,10 @@ async def api_link_create_or_update(
|
||||||
numbers.append(str(current_number))
|
numbers.append(str(current_number))
|
||||||
link.usescsv = ",".join(numbers)
|
link.usescsv = ",".join(numbers)
|
||||||
|
|
||||||
|
for k, v in data.dict().items():
|
||||||
|
if v is not None:
|
||||||
|
setattr(link, k, v)
|
||||||
|
|
||||||
link = await update_withdraw_link(link)
|
link = await update_withdraw_link(link)
|
||||||
else:
|
else:
|
||||||
link = await create_withdraw_link(wallet_id=key_info.wallet.id, data=data)
|
link = await create_withdraw_link(wallet_id=key_info.wallet.id, data=data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue