From ab6b53668ec5fbb82ae1b6a260db2a98e77a5823 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Sun, 24 Sep 2023 19:18:36 +0100 Subject: [PATCH] Fix webhook (#12) * refactor html * don't exclude values on update --- static/js/index.js | 24 +-- templates/lnurlp/index.html | 377 ++++++++++-------------------------- 2 files changed, 102 insertions(+), 299 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index e9951f1..4c09507 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -116,7 +116,6 @@ new Vue({ if (this.formDialog.fixedAmount) data.max = data.min if (data.currency === 'satoshis') data.currency = null if (isNaN(parseInt(data.comment_chars))) data.comment_chars = 0 - if (data.id) { this.updatePayLink(wallet, data) } else { @@ -131,33 +130,12 @@ new Vue({ } }, updatePayLink(wallet, data) { - let values = _.omit( - _.pick( - data, - 'description', - 'min', - 'max', - 'webhook_url', - 'success_text', - 'success_url', - 'comment_chars', - 'currency', - 'username', - 'zaps' - ), - (value, key) => - (key === 'webhook_url' || - key === 'success_text' || - key === 'success_url') && - (value === null || value === '') - ) - LNbits.api .request( 'PUT', '/lnurlp/api/v1/links/' + data.id, wallet.adminkey, - values + data ) .then(response => { this.payLinks = _.reject(this.payLinks, obj => obj.id === data.id) diff --git a/templates/lnurlp/index.html b/templates/lnurlp/index.html index 4b8202e..38f93c6 100644 --- a/templates/lnurlp/index.html +++ b/templates/lnurlp/index.html @@ -4,9 +4,7 @@
- New pay link + New pay link @@ -17,13 +15,7 @@
Pay links
- + {% raw %}