Merge branch 'main' into add_image_banner
This commit is contained in:
commit
38951a7ebe
5 changed files with 59 additions and 15 deletions
|
|
@ -27,7 +27,8 @@
|
|||
v-model.trim="formDialog.data.email"
|
||||
type="email"
|
||||
label="Your email "
|
||||
:rules="[val => emailValidation(val)]"
|
||||
:rules="[val => !!val || '* Required', val => emailValidation(val)]"
|
||||
lazy-rules
|
||||
></q-input>
|
||||
|
||||
<div class="row q-mt-lg">
|
||||
|
|
@ -122,10 +123,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
this.info = '{{ event_info | tojson }}'
|
||||
this.info = this.info.substring(1, this.info.length - 1)
|
||||
this.banner = JSON.parse('{{ event_banner | tojson |safe }}')
|
||||
await this.purgeUnpaidTickets()
|
||||
},
|
||||
computed: {
|
||||
formatDescription() {
|
||||
|
|
@ -154,8 +156,8 @@
|
|||
)
|
||||
},
|
||||
emailValidation(val) {
|
||||
let regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/g
|
||||
return !regex.test(val) || 'Please enter valid email.'
|
||||
let regex = /^[\w\.-]+@[a-zA-Z\d\.-]+\.[a-zA-Z]{2,}$/
|
||||
return regex.test(val) || 'Please enter valid email.'
|
||||
},
|
||||
|
||||
Invoice: function () {
|
||||
|
|
@ -228,6 +230,14 @@
|
|||
.catch(function (error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
})
|
||||
},
|
||||
async purgeUnpaidTickets() {
|
||||
try {
|
||||
await LNbits.api.request('GET', `/events/api/v1/purge/{{ event_id }}`)
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
LNbits.utils.notifyApiError(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -425,9 +425,11 @@
|
|||
this.g.user.wallets[0].inkey
|
||||
)
|
||||
.then(function (response) {
|
||||
self.tickets = response.data.map(function (obj) {
|
||||
return mapEvents(obj)
|
||||
})
|
||||
self.tickets = response.data
|
||||
.map(function (obj) {
|
||||
return mapEvents(obj)
|
||||
})
|
||||
.filter(e => e.paid)
|
||||
})
|
||||
},
|
||||
deleteTicket: function (ticketId) {
|
||||
|
|
@ -469,7 +471,6 @@
|
|||
self.events = response.data.map(function (obj) {
|
||||
return mapEvents(obj)
|
||||
})
|
||||
console.log(self.events)
|
||||
})
|
||||
},
|
||||
sendEventData: function () {
|
||||
|
|
@ -488,7 +489,7 @@
|
|||
createEvent: function (wallet, data) {
|
||||
var self = this
|
||||
LNbits.api
|
||||
.request('POST', '/events/api/v1/events', wallet.inkey, data)
|
||||
.request('POST', '/events/api/v1/events', wallet.adminkey, data)
|
||||
.then(function (response) {
|
||||
self.events.push(mapEvents(response.data))
|
||||
self.formDialog.show = false
|
||||
|
|
@ -512,7 +513,7 @@
|
|||
.request(
|
||||
'PUT',
|
||||
'/events/api/v1/events/' + data.id,
|
||||
wallet.inkey,
|
||||
wallet.adminkey,
|
||||
data
|
||||
)
|
||||
.then(function (response) {
|
||||
|
|
@ -538,7 +539,7 @@
|
|||
.request(
|
||||
'DELETE',
|
||||
'/events/api/v1/events/' + eventsId,
|
||||
_.findWhere(self.g.user.wallets, {id: events.wallet}).inkey
|
||||
_.findWhere(self.g.user.wallets, {id: events.wallet}).adminkey
|
||||
)
|
||||
.then(function (response) {
|
||||
self.events = _.reject(self.events, function (obj) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@
|
|||
},
|
||||
getEventTickets: function () {
|
||||
var self = this
|
||||
console.log('obj')
|
||||
LNbits.api
|
||||
.request(
|
||||
'GET',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue