From d0b2ec1250ae01549ecb8d7578d52b2f6a263ca3 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 13 Jul 2023 14:44:39 +0300 Subject: [PATCH] feat: allow to restore all products at once --- static/components/stall-details/stall-details.html | 2 ++ static/components/stall-details/stall-details.js | 6 ++++++ views_api.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/static/components/stall-details/stall-details.html b/static/components/stall-details/stall-details.html index 0ec712b..ad9449e 100644 --- a/static/components/stall-details/stall-details.html +++ b/static/components/stall-details/stall-details.html @@ -191,6 +191,8 @@ There are no products to be restored.
+ Restore All Close
diff --git a/static/components/stall-details/stall-details.js b/static/components/stall-details/stall-details.js index 9cffd57..6a41a43 100644 --- a/static/components/stall-details/stall-details.js +++ b/static/components/stall-details/stall-details.js @@ -318,6 +318,12 @@ async function stallDetails(path) { pendingProduct.pending = true await this.showNewProductDialog(pendingProduct) }, + restoreAllPendingProducts: async function () { + for (const p of this.pendingProducts){ + p.pending = false + await this.updateProduct(p) + } + }, customerSelectedForOrder: function (customerPubkey) { this.$emit('customer-selected-for-order', customerPubkey) } diff --git a/views_api.py b/views_api.py index f78b401..26d295a 100644 --- a/views_api.py +++ b/views_api.py @@ -219,7 +219,7 @@ async def api_republish_merchant( @nostrmarket_ext.put("/api/v1/merchant/{merchant_id}/toggle") -async def api_republish_merchant( +async def api_toggle_merchant( merchant_id: str, wallet: WalletTypeInfo = Depends(require_admin_key), ) -> Merchant: