Skip to content

Commit

Permalink
fix: update link
Browse files Browse the repository at this point in the history
  • Loading branch information
talvasconcelos committed Oct 25, 2024
1 parent adf5faa commit c0e85cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from typing import Optional

from fastapi import APIRouter, Depends, HTTPException, Query, Request

from lnbits.core.crud import get_user
from lnbits.core.models import WalletTypeInfo
from lnbits.decorators import require_admin_key, require_invoice_key
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl

from .crud import (
create_withdraw_link,
Expand Down Expand Up @@ -134,6 +134,10 @@ async def api_link_create_or_update(
numbers.append(str(current_number))
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)
else:
link = await create_withdraw_link(wallet_id=key_info.wallet.id, data=data)
Expand Down

0 comments on commit c0e85cb

Please sign in to comment.