fix: fetch tickets and forms JS and endpoints

This commit is contained in:
Stefan Stammberger
2021-09-28 22:03:45 +02:00
parent 85d9a3fcc3
commit f827d2ce18
2 changed files with 4 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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(