fix: set merchant after create

This commit is contained in:
Vlad Stan 2023-02-28 12:28:51 +02:00
parent 2b106a203e
commit 7c15f8ff45

View file

@ -20,14 +20,19 @@ const merchant = async () => {
const privkey = nostr.generatePrivateKey() const privkey = nostr.generatePrivateKey()
const pubkey = nostr.getPublicKey(privkey) const pubkey = nostr.getPublicKey(privkey)
const data = {private_key: privkey, public_key: pubkey, config: {}} const payload = {private_key: privkey, public_key: pubkey, config: {}}
try { try {
await LNbits.api.request( const {data} = await LNbits.api.request(
'POST', 'POST',
'/nostrmarket/api/v1/merchant', '/nostrmarket/api/v1/merchant',
this.g.user.wallets[0].adminkey, this.g.user.wallets[0].adminkey,
data payload
) )
this.merchant = data
this.$q.notify({
type: 'positive',
message: 'Keys generated!'
})
} catch (error) { } catch (error) {
LNbits.utils.notifyApiError(error) LNbits.utils.notifyApiError(error)
} }