diff --git a/static/components/merchant-details/merchant-details.html b/static/components/merchant-details/merchant-details.html index 2485447..802a31f 100644 --- a/static/components/merchant-details/merchant-details.html +++ b/static/components/merchant-details/merchant-details.html @@ -24,9 +24,17 @@ > + + + Republish to Nostr + Republish all stalls, products and orders to Nostr + + - Delete Merchant from DB + Delete from DB Delete all stalls, products and orders from database @@ -34,7 +42,7 @@ - Delete Merchant from Nostr + Delete from Nostr Delete all stalls, products and orders from Nostr diff --git a/static/components/merchant-details/merchant-details.js b/static/components/merchant-details/merchant-details.js index 297ce36..d190249 100644 --- a/static/components/merchant-details/merchant-details.js +++ b/static/components/merchant-details/merchant-details.js @@ -15,6 +15,31 @@ async function merchantDetails(path) { this.showKeys = !this.showKeys this.$emit('show-keys', this.showKeys) }, + + republishMerchantData: function () { + LNbits.utils + .confirmDialog( + `You are about to republish to Nostr` + ) + .onOk(async () => { + try { + await LNbits.api.request( + 'PATCH', + `/nostrmarket/api/v1/merchant/${this.merchantId}/nostr`, + this.adminkey + ) + this.$emit('merchant-deleted', this.merchantId) + this.$q.notify({ + type: 'positive', + message: 'Merchant Deleted', + timeout: 5000 + }) + } catch (error) { + console.warn(error) + LNbits.utils.notifyApiError(error) + } + }) + }, deleteMerchantTables: function () { LNbits.utils .confirmDialog( diff --git a/views_api.py b/views_api.py index df436aa..2e209df 100644 --- a/views_api.py +++ b/views_api.py @@ -153,7 +153,6 @@ async def api_delete_merchant( merchant_id: str, wallet: WalletTypeInfo = Depends(require_admin_key), ): - try: merchant = await get_merchant_for_user(wallet.wallet.user) assert merchant, "Merchant cannot be found"