Skip to content

Commit

Permalink
Fix updating event (#9)
Browse files Browse the repository at this point in the history
* passing a copy of original data to dialog data
  • Loading branch information
talvasconcelos authored Jul 4, 2023
1 parent 1d57e1a commit 4586164
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
16 changes: 3 additions & 13 deletions templates/events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,7 @@ <h6 class="text-subtitle1 q-my-none">
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)
})
})
Expand Down Expand Up @@ -464,21 +462,13 @@ <h6 class="text-subtitle1 q-my-none">
},
updateformDialog: function (formId) {
var link = _.findWhere(this.events, {id: formId})
console.log(link.id)
this.formDialog.data.id = link.id
this.formDialog.data.wallet = link.wallet
this.formDialog.data.name = link.name
this.formDialog.data.info = link.info
this.formDialog.data.closing_date = link.closing_date
this.formDialog.data.event_start_date = link.event_start_date
this.formDialog.data.event_end_date = link.event_end_date
this.formDialog.data.amount_tickets = link.amount_tickets
this.formDialog.data.price_per_ticket = link.price_per_ticket

this.formDialog.data = {...link}

this.formDialog.show = true
},
updateEvent: function (wallet, data) {
var self = this
console.log(data)

LNbits.api
.request(
Expand Down
10 changes: 7 additions & 3 deletions templates/events/ticket.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ <h5 class="q-my-none">
</h5>
<br />
<q-responsive :ratio="1" class="q-mb-md" style="max-width: 300px">
<qrcode :value="'ticket://{{ ticket_id }}'" :options="{width: 500}"></qrcode>
<qrcode
:value="'ticket://{{ ticket_id }}'"
:options="{width: 500}"
></qrcode>
</q-responsive>
<br />
<q-btn @click="printWindow" color="grey" class="q-ml-auto">
<q-icon left size="3em" name="print"></q-icon> Print</q-btn>
<q-icon left size="3em" name="print"></q-icon> Print</q-btn
>
</center>
</q-card-section>
</q-card>
Expand All @@ -38,4 +42,4 @@ <h5 class="q-my-none">
}
})
</script>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from fastapi import Depends, Query
from starlette.exceptions import HTTPException

from lnbits.core.crud import get_user, get_standalone_payment
from lnbits.core.crud import get_standalone_payment, get_user
from lnbits.core.services import create_invoice
from lnbits.decorators import WalletTypeInfo, get_key_type

Expand Down

0 comments on commit 4586164

Please sign in to comment.