Skip to content

Commit

Permalink
rc5 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Oct 18, 2024
1 parent 8394e56 commit cab62b5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
5 changes: 3 additions & 2 deletions crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ async def get_withdraw_links(
WithdrawLink, # type: ignore
)

total = await db.fetchone(
result = await db.execute(
f"""
SELECT COUNT(*) as total FROM withdraw.withdraw_link
WHERE wallet IN ({q})
"""
)
total = await result.mappings().first()

return links, total["total"]
return links, total.total


async def remove_unique_withdraw_link(link: WithdrawLink, unique_hash: str) -> None:
Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Optional

from fastapi import APIRouter, Depends, HTTPException, Query, Request
from lnbits.core.crud import get_user_by_id
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
Expand Down Expand Up @@ -32,7 +32,7 @@ async def api_links(
wallet_ids = [key_info.wallet.id]

if all_wallets:
user = await get_user_by_id(key_info.wallet.user)
user = await get_user(key_info.wallet.user)
wallet_ids = user.wallet_ids if user else []

try:
Expand Down

0 comments on commit cab62b5

Please sign in to comment.