Skip to content

Commit

Permalink
feat(price list): order by last created
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 22, 2023
1 parent 21c9fdb commit 48f7d12
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/views/PriceList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<h1 class="mb-1">Last prices</h1>
<h1 class="mb-1">
Last prices
<v-progress-circular v-if="loading" indeterminate :size="30"></v-progress-circular>
</h1>

<v-row>
<v-col cols="12" sm="6" md="4" v-for="price in prices" :key="price">
Expand All @@ -19,16 +22,19 @@ export default {
data() {
return {
prices: [],
loading: false,
}
},
mounted() {
this.getPrices()
},
methods: {
getPrices() {
return api.getPrices({ order_by: '-date' })
this.loading = true
return api.getPrices({ order_by: '-created' })
.then((data) => {
this.prices = data.items
this.loading = false
})
}
}
Expand Down

0 comments on commit 48f7d12

Please sign in to comment.