mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-29 13:22:37 +02:00
creating but not fetching
This commit is contained in:
@@ -15,7 +15,9 @@ from .models import (
|
||||
from lnbits.helpers import urlsafe_short_hash
|
||||
|
||||
|
||||
async def create_satsdice_pay(data: CreateSatsDiceLink,) -> satsdiceLink:
|
||||
async def create_satsdice_pay(
|
||||
data: CreateSatsDiceLink,
|
||||
) -> satsdiceLink:
|
||||
satsdice_id = urlsafe_short_hash()
|
||||
await db.execute(
|
||||
"""
|
||||
|
@@ -27,8 +27,8 @@ class satsdiceLink(BaseModel):
|
||||
base_url: str
|
||||
open_time: int
|
||||
|
||||
def lnurl(self, req: Request) -> Lnurl:
|
||||
return lnurl_encode(req.url_for("satsdice.lnurlp_response", item_id=self.id))
|
||||
def lnurl(self, req: Request) -> str:
|
||||
return lnurl_encode(req.url_for("satsdice.lnurlp_response", link_id=self.id))
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "satsdiceLink":
|
||||
|
@@ -359,6 +359,7 @@
|
||||
},
|
||||
openQrCodeDialog(linkId) {
|
||||
var link = _.findWhere(this.payLinks, {id: linkId})
|
||||
console.log(link)
|
||||
if (link.currency) this.updateFiatRate(link.currency)
|
||||
|
||||
this.qrCodeDialog.data = {
|
||||
@@ -512,8 +513,6 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log('this.multiValue')
|
||||
console.log(this.g.user)
|
||||
if (this.g.user.wallets.length) {
|
||||
var getPayLinks = this.getPayLinks
|
||||
getPayLinks()
|
||||
|
@@ -29,7 +29,7 @@ from fastapi.param_functions import Query
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
|
||||
@satsdice_ext.get("/", response_class=HTMLResponse)
|
||||
@satsdice_ext.get("/")
|
||||
async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||
return satsdice_renderer().TemplateResponse(
|
||||
"satsdice/index.html", {"request": request, "user": user.dict()}
|
||||
|
@@ -40,9 +40,8 @@ async def api_links(
|
||||
|
||||
try:
|
||||
links = await get_satsdice_pays(wallet_ids)
|
||||
print(links[0])
|
||||
|
||||
return [{link.dict(), {"lnurl": link.lnurl(request)}} for link in links]
|
||||
return [{**link.dict(), **{"lnurl": link.lnurl(request)}} for link in links]
|
||||
except LnurlInvalidUrl:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.UPGRADE_REQUIRED,
|
||||
@@ -99,7 +98,7 @@ async def api_link_create_or_update(
|
||||
data.wallet_id = wallet.wallet.id
|
||||
link = await create_satsdice_pay(data)
|
||||
|
||||
return {link.dict(), {"lnurl": link.lnurl}}
|
||||
return {**link.dict(), **{"lnurl": link.lnurl}}
|
||||
|
||||
|
||||
@satsdice_ext.delete("/api/v1/links/{link_id}")
|
||||
|
Reference in New Issue
Block a user