feat: allow delete merchant from nostr
This commit is contained in:
parent
260bea9ccf
commit
05ecc65e5a
7 changed files with 141 additions and 11 deletions
|
|
@ -15,7 +15,7 @@ async function merchantDetails(path) {
|
|||
this.showKeys = !this.showKeys
|
||||
this.$emit('show-keys', this.showKeys)
|
||||
},
|
||||
deleteMerchant: function () {
|
||||
deleteMerchantTables: function () {
|
||||
LNbits.utils
|
||||
.confirmDialog(
|
||||
`
|
||||
|
|
@ -30,7 +30,6 @@ async function merchantDetails(path) {
|
|||
'/nostrmarket/api/v1/merchant/' + this.merchantId,
|
||||
this.adminkey
|
||||
)
|
||||
// todo: refresh parent page
|
||||
this.$emit('merchant-deleted', this.merchantId)
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
|
|
@ -42,6 +41,31 @@ async function merchantDetails(path) {
|
|||
LNbits.utils.notifyApiError(error)
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteMerchantFromNostr: function () {
|
||||
LNbits.utils
|
||||
.confirmDialog(
|
||||
`
|
||||
Do you want to remove the merchant from Nostr?
|
||||
`
|
||||
)
|
||||
.onOk(async () => {
|
||||
try {
|
||||
await LNbits.api.request(
|
||||
'DELETE',
|
||||
`/nostrmarket/api/v1/merchant/${this.merchantId}/nostr`,
|
||||
this.adminkey
|
||||
)
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
message: 'Merchant Deleted from Nostr',
|
||||
timeout: 5000
|
||||
})
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
LNbits.utils.notifyApiError(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created: async function () {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue