feat: allow delete merchant from nostr
This commit is contained in:
parent
260bea9ccf
commit
05ecc65e5a
7 changed files with 141 additions and 11 deletions
|
|
@ -354,8 +354,9 @@ async function customerStall(path) {
|
|||
this.qrCodeDialog.data.message = json.message
|
||||
return cb()
|
||||
}
|
||||
let payment_request = json.payment_options.find(o => o.type == 'ln')
|
||||
.link
|
||||
let payment_request = json.payment_options.find(
|
||||
o => o.type == 'ln'
|
||||
).link
|
||||
if (!payment_request) return
|
||||
this.loading = false
|
||||
this.qrCodeDialog.data.payment_request = payment_request
|
||||
|
|
|
|||
|
|
@ -24,11 +24,19 @@
|
|||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item @click="deleteMerchant" clickable v-close-popup>
|
||||
<q-item @click="deleteMerchantTables" clickable v-close-popup>
|
||||
<q-item-section>
|
||||
<q-item-label>Delete Merchant</q-item-label>
|
||||
<q-item-label>Delete Merchant from DB</q-item-label>
|
||||
<q-item-label caption
|
||||
>Delete all stalls, products and orders</q-item-label
|
||||
>Delete all stalls, products and orders from database</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item @click="deleteMerchantFromNostr" clickable v-close-popup>
|
||||
<q-item-section>
|
||||
<q-item-label>Delete Merchant from Nostr</q-item-label>
|
||||
<q-item-label caption
|
||||
>Delete all stalls, products and orders from Nostr</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
|
|
|||
|
|
@ -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 () {}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const merchant = async () => {
|
|||
toggleMerchantKeys: function (value) {
|
||||
this.showKeys = value
|
||||
},
|
||||
handleMerchantDeleted: function() {
|
||||
handleMerchantDeleted: function () {
|
||||
this.merchant = null
|
||||
this.shippingZones = []
|
||||
this.activeChatCustomer = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue