Skip to content

Commit

Permalink
feat(stats): new location total stat (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Jan 13, 2024
1 parent 130c3b1 commit 05af0b2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/views/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</v-card-text>
</v-card>
</v-col>

<v-col cols="12" md="6" lg="4">
<v-card title="Products" height="100%">
<v-card-text>
Expand All @@ -37,6 +38,17 @@
</v-card-text>
</v-card>
</v-col>

<v-col cols="12" md="6" lg="4">
<v-card title="Locations" height="100%">
<v-card-text>
<p>
Total
<strong>{{ locationTotal }}</strong>
</p>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>

Expand All @@ -51,6 +63,7 @@ export default {
priceWithoutProduct: null,
productTotal: null,
productWithPriceTotal: null,
locationTotal: null,
loading: false,
}
},
Expand All @@ -64,6 +77,7 @@ export default {
this.getPricesWithProduct()
this.getProducts()
this.getProductsWithPrice()
this.getLocations()
},
methods: {
getPrices() {
Expand Down Expand Up @@ -98,6 +112,14 @@ export default {
this.loading = false
})
},
getLocations() {
this.loading = true
return api.getLocations({ size: 1 })
.then((data) => {
this.locationTotal = data.total
this.loading = false
})
}
}
}
</script>

0 comments on commit 05af0b2

Please sign in to comment.