feat: orders improvements

This commit is contained in:
Vlad Stan 2023-07-12 11:25:16 +03:00
parent edef69c92c
commit 31ef362d34
2 changed files with 9 additions and 4 deletions

View file

@ -5,12 +5,11 @@
</q-card-section> </q-card-section>
</q-card> </q-card>
<div v-for="merchant in merchantOrders"> <div v-for="merchant in merchantOrders">
<q-card bordered class="q-mb-md"> <q-card bordered class="q-mb-md">
<q-item> <q-item>
<q-item-section avatar> <q-item-section avatar>
<q-avatar> <q-avatar>
<img v-if="merchant?.profile?.picture" :src="merchant?.profile?.picture"> <img v-if="merchant.profile?.picture" :src="merchant.profile?.picture">
<img v-else src="/nostrmarket/static/images/blank-avatar.webp"> <img v-else src="/nostrmarket/static/images/blank-avatar.webp">
</q-avatar> </q-avatar>
</q-item-section> </q-item-section>
@ -18,7 +17,7 @@
<q-item-section> <q-item-section>
<q-item-label> <q-item-label>
<strong> <strong>
<span v-text="merchant.profile?.name"></span>
</strong> </strong>
</q-item-label> </q-item-label>
<q-item-label caption> <q-item-label caption>

View file

@ -11,7 +11,13 @@ async function customerOrders(path) {
}, },
computed: { computed: {
merchantOrders: function () { merchantOrders: function () {
return Object.keys(this.orders).map(pubkey => ({ pubkey, orders: this.orders[pubkey].map(this.enrichOrder) })) return Object.keys(this.orders)
.map(pubkey => ({
pubkey,
profile: this.merchantProfile(pubkey),
orders: this.orders[pubkey].map(this.enrichOrder)
}
))
} }
}, },
methods: { methods: {