mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 06:48:02 +01:00
general clean up
This commit is contained in:
parent
6a4170f4cc
commit
c90cf6ee1b
3 changed files with 6 additions and 24 deletions
|
@ -1,8 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "scrub",
|
"name": "Scrub",
|
||||||
"short_description": "Pass payments to LNURLp/LNaddress",
|
"short_description": "Pass payments to LNURLp/LNaddress",
|
||||||
"icon": "send",
|
"icon": "send",
|
||||||
"contributors": [
|
"contributors": ["arcbtc"]
|
||||||
"arcbtc"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||||
"scrub/index.html", {"request": request, "user": user.dict()}
|
"scrub/index.html", {"request": request, "user": user.dict()}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# DO WE NEED THIS ?!
|
||||||
@scrub_ext.get("/{link_id}", response_class=HTMLResponse)
|
@scrub_ext.get("/{link_id}", response_class=HTMLResponse)
|
||||||
async def display(request: Request, link_id):
|
async def display(request: Request, link_id):
|
||||||
link = await get_scrub_link(link_id)
|
link = await get_scrub_link(link_id)
|
||||||
|
@ -32,7 +32,7 @@ async def display(request: Request, link_id):
|
||||||
ctx = {"request": request, "lnurl": link.lnurl(req=request)}
|
ctx = {"request": request, "lnurl": link.lnurl(req=request)}
|
||||||
return scrub_renderer().TemplateResponse("scrub/display.html", ctx)
|
return scrub_renderer().TemplateResponse("scrub/display.html", ctx)
|
||||||
|
|
||||||
|
# DO WE NEED THIS ?!
|
||||||
@scrub_ext.get("/print/{link_id}", response_class=HTMLResponse)
|
@scrub_ext.get("/print/{link_id}", response_class=HTMLResponse)
|
||||||
async def print_qr(request: Request, link_id):
|
async def print_qr(request: Request, link_id):
|
||||||
link = await get_scrub_link(link_id)
|
link = await get_scrub_link(link_id)
|
||||||
|
|
|
@ -8,7 +8,6 @@ from starlette.exceptions import HTTPException
|
||||||
|
|
||||||
from lnbits.core.crud import get_user
|
from lnbits.core.crud import get_user
|
||||||
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
||||||
from lnbits.utils.exchange_rates import currencies, get_fiat_rate_satoshis
|
|
||||||
|
|
||||||
from . import scrub_ext
|
from . import scrub_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
|
@ -18,12 +17,7 @@ from .crud import (
|
||||||
get_scrub_links,
|
get_scrub_links,
|
||||||
update_scrub_link,
|
update_scrub_link,
|
||||||
)
|
)
|
||||||
from .models import CreateScrubLink, ScrubLink
|
from .models import CreateScrubLink
|
||||||
|
|
||||||
|
|
||||||
@scrub_ext.get("/api/v1/currencies")
|
|
||||||
async def api_list_currencies_available():
|
|
||||||
return list(currencies.keys())
|
|
||||||
|
|
||||||
|
|
||||||
@scrub_ext.get("/api/v1/links", status_code=HTTPStatus.OK)
|
@scrub_ext.get("/api/v1/links", status_code=HTTPStatus.OK)
|
||||||
|
@ -39,7 +33,7 @@ async def api_links(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return [
|
return [
|
||||||
{**link.dict()}
|
link.dict()
|
||||||
for link in await get_scrub_links(wallet_ids)
|
for link in await get_scrub_links(wallet_ids)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -112,13 +106,3 @@ async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(require_admi
|
||||||
|
|
||||||
await delete_scrub_link(link_id)
|
await delete_scrub_link(link_id)
|
||||||
raise HTTPException(status_code=HTTPStatus.NO_CONTENT)
|
raise HTTPException(status_code=HTTPStatus.NO_CONTENT)
|
||||||
|
|
||||||
|
|
||||||
@scrub_ext.get("/api/v1/rate/{currency}", status_code=HTTPStatus.OK)
|
|
||||||
async def api_check_fiat_rate(currency):
|
|
||||||
try:
|
|
||||||
rate = await get_fiat_rate_satoshis(currency)
|
|
||||||
except AssertionError:
|
|
||||||
rate = None
|
|
||||||
|
|
||||||
return {"rate": rate}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue