mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-28 21:02:31 +02:00
typos fix
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
from quart import g, abort, render_template
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
from lnbits.decorators import check_user_exists, validate_uuids
|
from lnbits.decorators import check_user_exists, validate_uuids
|
||||||
|
@@ -29,19 +29,18 @@ async def api_list_currencies_available():
|
|||||||
|
|
||||||
@lnurlp_ext.get("/api/v1/links", status_code=HTTPStatus.OK)
|
@lnurlp_ext.get("/api/v1/links", status_code=HTTPStatus.OK)
|
||||||
# @api_check_wallet_key("invoice")
|
# @api_check_wallet_key("invoice")
|
||||||
async def api_links(wallet: WalletTypeInfo = Depends(get_key_type)):
|
async def api_links(wallet: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False)):
|
||||||
wallet_ids = [wallet.wallet.id]
|
wallet_ids = [wallet.wallet.id]
|
||||||
|
|
||||||
if "all_wallets" in Request.path_parameters:
|
if all_wallets:
|
||||||
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return (
|
return [
|
||||||
[
|
|
||||||
{**link._asdict(), **{"lnurl": link.lnurl}}
|
{**link._asdict(), **{"lnurl": link.lnurl}}
|
||||||
for link in await get_pay_links(wallet_ids)
|
for link in await get_pay_links(wallet_ids)
|
||||||
],
|
]
|
||||||
)
|
|
||||||
except LnurlInvalidUrl:
|
except LnurlInvalidUrl:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.UPGRADE_REQUIRED,
|
status_code=HTTPStatus.UPGRADE_REQUIRED,
|
||||||
@@ -145,7 +144,7 @@ async def api_link_create_or_update(data: CreateData, link_id=None, wallet: Wall
|
|||||||
|
|
||||||
@lnurlp_ext.delete("/api/v1/links/{link_id}")
|
@lnurlp_ext.delete("/api/v1/links/{link_id}")
|
||||||
# @api_check_wallet_key("invoice")
|
# @api_check_wallet_key("invoice")
|
||||||
async def api_link_delete(link_id, , wallet: WalletTypeInfo = Depends(get_key_type)):
|
async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(get_key_type)):
|
||||||
link = await get_pay_link(link_id)
|
link = await get_pay_link(link_id)
|
||||||
|
|
||||||
if not link:
|
if not link:
|
||||||
|
Reference in New Issue
Block a user