Changed webhook to actually optional

This commit is contained in:
Ben Arc 2021-08-16 07:33:47 +01:00
parent 1359c1ee39
commit 3dd94dd710
2 changed files with 2 additions and 21 deletions

View File

@ -318,8 +318,7 @@
formDialog: {
show: false,
data: {flatrate: false}
},
cancelListener: () => {}
}
}
},
computed: {
@ -478,30 +477,12 @@
},
exportformsCSV: function () {
LNbits.utils.exportCSV(this.formsTable.columns, this.forms)
},
startPaymentNotifier() {
this.cancelListener()
this.cancelListener = LNbits.events.onInvoicePaid(
this.g.user.wallets[0],
payment => {
this.getTickets()
this.$q.notify({
type: 'positive',
message: 'New ticket arrived!',
icon: 'textsms'
})
}
)
}
},
created: function () {
if (this.g.user.wallets.length) {
this.getTickets()
this.getForms()
this.startPaymentNotifier()
}
}
})

View File

@ -45,7 +45,7 @@ async def api_forms():
schema={
"wallet": {"type": "string", "empty": False, "required": True},
"name": {"type": "string", "empty": False, "required": True},
"webhook": {"type": "string", "empty": False, "required": False},
"webhook": {"type": "string", "required": False},
"description": {"type": "string", "min": 0, "required": True},
"amount": {"type": "integer", "min": 0, "required": True},
"flatrate": {"type": "integer", "required": True},