From 7c15f8ff45631ef4edaad2ebe40a552503230a37 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 28 Feb 2023 12:28:51 +0200 Subject: [PATCH] fix: set merchant after create --- static/js/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index 5bc293f..561c6ec 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -20,14 +20,19 @@ const merchant = async () => { const privkey = nostr.generatePrivateKey() const pubkey = nostr.getPublicKey(privkey) - const data = {private_key: privkey, public_key: pubkey, config: {}} + const payload = {private_key: privkey, public_key: pubkey, config: {}} try { - await LNbits.api.request( + const {data} = await LNbits.api.request( 'POST', '/nostrmarket/api/v1/merchant', this.g.user.wallets[0].adminkey, - data + payload ) + this.merchant = data + this.$q.notify({ + type: 'positive', + message: 'Keys generated!' + }) } catch (error) { LNbits.utils.notifyApiError(error) }