(TEMP) fix tickets not showing after payment (#292)
This commit is contained in:
parent
6312b5b564
commit
b7ed7fab59
|
@ -345,7 +345,7 @@ async def api_payments_sse():
|
|||
message = [f"event: {typ}".encode("utf-8")]
|
||||
|
||||
if data:
|
||||
jdata = json.dumps(dict(data._asdict(), pending=False))
|
||||
jdata = json.dumps(dict(data._asdict(), pending=False), default=str)
|
||||
message.append(f"data: {jdata}".encode("utf-8"))
|
||||
|
||||
yield b"\n".join(message) + b"\r\n\r\n"
|
||||
|
|
|
@ -26,12 +26,10 @@ async def on_invoice_paid(payment: Payment) -> None:
|
|||
# not a lnticket invoice
|
||||
return
|
||||
|
||||
ticket = await get_ticket(payment.checking_id)
|
||||
ticket = await get_ticket(payment.payment_hash)
|
||||
if not ticket:
|
||||
print("this should never happen", payment)
|
||||
return
|
||||
|
||||
await payment.set_pending(False)
|
||||
await set_ticket_paid(payment.payment_hash)
|
||||
_ticket = await get_ticket(payment.checking_id)
|
||||
print("ticket", _ticket)
|
||||
|
|
|
@ -314,7 +314,7 @@
|
|||
'/lnticket/api/v1/tickets?all_wallets',
|
||||
this.g.user.wallets[0].inkey
|
||||
)
|
||||
.then(function (response) {
|
||||
.then(function (response) {
|
||||
self.tickets = response.data
|
||||
.map(function (obj) {
|
||||
if (!obj?.paid) return
|
||||
|
|
|
@ -92,7 +92,6 @@ async def api_tickets():
|
|||
|
||||
if "all_wallets" in request.args:
|
||||
wallet_ids = (await get_user(g.wallet.user)).wallet_ids
|
||||
|
||||
return (
|
||||
jsonify([form._asdict() for form in await get_tickets(wallet_ids)]),
|
||||
HTTPStatus.OK,
|
||||
|
|
Loading…
Reference in New Issue
Block a user