events fix tickets not showing in index.html

This commit is contained in:
Tiago vasconcelos 2021-10-20 10:54:17 +01:00
parent 552fa8edc6
commit 39eb9d0d70
3 changed files with 10 additions and 5 deletions

View File

@ -74,6 +74,9 @@ async def get_tickets(wallet_ids: Union[str, List[str]]) -> List[Tickets]:
async def delete_ticket(payment_hash: str) -> None:
await db.execute("DELETE FROM events.ticket WHERE id = ?", (payment_hash,))
async def delete_event_tickets(event_id: str) -> None:
await db.execute("DELETE FROM events.tickets WHERE event = ?", (event_id,))
# EVENTS

View File

@ -380,14 +380,14 @@
methods: {
getTickets: function () {
var self = this
console.log('obj')
LNbits.api
.request(
'GET',
'/events/api/v1/tickets?all_wallets',
this.g.user.wallets[0].inkey
.request(
'GET',
'/events/api/v1/tickets?all_wallets=true',
this.g.user.wallets[0].inkey
)
.then(function (response) {
console.log(response)
self.tickets = response.data.map(function (obj) {
console.log(obj)
return mapEvents(obj)

View File

@ -15,6 +15,7 @@ from .crud import (
create_event,
create_ticket,
delete_event,
delete_event_tickets,
delete_ticket,
get_event,
get_event_tickets,
@ -81,6 +82,7 @@ async def api_form_delete(event_id, wallet: WalletTypeInfo = Depends(get_key_typ
)
await delete_event(event_id)
await delete_event_tickets(event_id)
raise HTTPException(status_code=HTTPStatus.NO_CONTENT)