mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 20:36:16 +02:00
fix: fetch tickets and forms JS and endpoints
This commit is contained in:
@@ -337,7 +337,7 @@
|
|||||||
LNbits.api
|
LNbits.api
|
||||||
.request(
|
.request(
|
||||||
'GET',
|
'GET',
|
||||||
'/lnticket/api/v1/tickets?all_wallets',
|
'/lnticket/api/v1/tickets?all_wallets=true',
|
||||||
this.g.user.wallets[0].inkey
|
this.g.user.wallets[0].inkey
|
||||||
)
|
)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
@@ -382,7 +382,7 @@
|
|||||||
LNbits.api
|
LNbits.api
|
||||||
.request(
|
.request(
|
||||||
'GET',
|
'GET',
|
||||||
'/lnticket/api/v1/forms?all_wallets',
|
'/lnticket/api/v1/forms?all_wallets=true',
|
||||||
this.g.user.wallets[0].inkey
|
this.g.user.wallets[0].inkey
|
||||||
)
|
)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
@@ -40,9 +40,7 @@ async def api_forms_get(r: Request, all_wallets: bool = Query(False), wallet: Wa
|
|||||||
if all_wallets:
|
if all_wallets:
|
||||||
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
||||||
|
|
||||||
return (
|
return [form.dict() for form in await get_forms(wallet_ids)]
|
||||||
[form.dict() for form in await get_forms(wallet_ids)],
|
|
||||||
)
|
|
||||||
|
|
||||||
@lnticket_ext.post("/api/v1/forms", status_code=HTTPStatus.CREATED)
|
@lnticket_ext.post("/api/v1/forms", status_code=HTTPStatus.CREATED)
|
||||||
@lnticket_ext.put("/api/v1/forms/{form_id}")
|
@lnticket_ext.put("/api/v1/forms/{form_id}")
|
||||||
@@ -117,9 +115,7 @@ async def api_tickets(all_wallets: bool = Query(False), wallet: WalletTypeInfo =
|
|||||||
if all_wallets:
|
if all_wallets:
|
||||||
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
||||||
|
|
||||||
return (
|
return [form.dict() for form in await get_tickets(wallet_ids)]
|
||||||
[form.dict() for form in await get_tickets(wallet_ids)]
|
|
||||||
)
|
|
||||||
|
|
||||||
@lnticket_ext.post("/api/v1/tickets/{form_id}", status_code=HTTPStatus.CREATED)
|
@lnticket_ext.post("/api/v1/tickets/{form_id}", status_code=HTTPStatus.CREATED)
|
||||||
# @api_validate_post_request(
|
# @api_validate_post_request(
|
||||||
|
Reference in New Issue
Block a user