@@ -74,6 +72,7 @@
:currencies="currencies"
@stall-deleted="handleStallDeleted"
@stall-updated="handleStallUpdated"
+ @customer-selected-for-order="customerSelectedForOrder"
>
diff --git a/static/components/stall-list/stall-list.js b/static/components/stall-list/stall-list.js
index d41c062..dca7fb9 100644
--- a/static/components/stall-list/stall-list.js
+++ b/static/components/stall-list/stall-list.js
@@ -170,6 +170,9 @@ async function stallList(path) {
shippingZones: []
}
this.stallDialog.show = true
+ },
+ customerSelectedForOrder: function (customerPubkey) {
+ this.$emit('customer-selected-for-order', customerPubkey)
}
},
created: async function () {
diff --git a/static/js/index.js b/static/js/index.js
index d530977..75e6f01 100644
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -20,6 +20,7 @@ const merchant = async () => {
return {
merchant: {},
shippingZones: [],
+ activeChatCustomer: '',
showKeys: false,
importKeyDialog: {
show: false,
@@ -92,6 +93,9 @@ const merchant = async () => {
} catch (error) {
LNbits.utils.notifyApiError(error)
}
+ },
+ customerSelectedForOrder: function (customerPubkey) {
+ this.activeChatCustomer = customerPubkey
}
},
created: async function () {
diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html
index 32d0ca0..8907395 100644
--- a/templates/nostrmarket/index.html
+++ b/templates/nostrmarket/index.html
@@ -37,6 +37,7 @@
:adminkey="g.user.wallets[0].adminkey"
:inkey="g.user.wallets[0].inkey"
:wallet-options="g.user.walletOptions"
+ @customer-selected-for-order="customerSelectedForOrder"
>
@@ -114,6 +115,7 @@
diff --git a/views_api.py b/views_api.py
index bc3a9e3..cefac0a 100644
--- a/views_api.py
+++ b/views_api.py
@@ -645,14 +645,11 @@ async def api_update_order_status(
try:
assert data.shipped != None, "Shipped value is required for order"
merchant = await get_merchant_for_user(wallet.wallet.user)
- assert merchant, "Merchant cannot be found"
+ assert merchant, "Merchant cannot be found for order {data.id}"
order = await update_order_shipped_status(merchant.id, data.id, data.shipped)
assert order, "Cannot find updated order"
- merchant = await get_merchant_for_user(merchant.id)
- assert merchant, f"Merchant cannot be found for order {data.id}"
-
data.paid = order.paid
dm_content = json.dumps(data.dict(), separators=(",", ":"), ensure_ascii=False)