Skip to content

Commit

Permalink
Error message if Proof not found or not owner
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 24, 2024
1 parent 1dd9159 commit 8327fb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@
"Success": "Proof deleted!"
},
"ProofDetail": {
"LoadMore": "Load more",
"Prices": "Prices",
"LoadMore": "Load more"
"ProofNotFound": "Proof not found (or not the owner)"
},
"Router": {
"AddPrice": {
Expand Down
9 changes: 5 additions & 4 deletions src/views/ProofDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
<v-row>
<v-col cols="12" sm="6">
<ProofCard v-if="proof" :proof="proof" :readonly="true"></ProofCard>
<p v-if="!loading && !proof" class="text-red">{{ $t('ProofDetail.ProofNotFound') }}</p>
</v-col>
</v-row>

<br />

<h2 class="text-h6 mb-1">
<h2 class="text-h6 mb-1" v-if="proof">
{{ $t('ProofDetail.Prices') }}
<v-progress-circular v-if="loading" indeterminate :size="30"></v-progress-circular>
</h2>

<v-row>
<v-row v-if="proof">
<v-col cols="12" sm="6" md="4" v-for="price in proofPriceList" :key="price">
<PriceCard :price="price" :product="price.product" :hidePriceProof="true" elevation="1" height="100%"></PriceCard>
</v-col>
</v-row>

<v-row v-if="proofPriceList.length < proofPriceTotal" class="mb-2">
<v-row v-if="proof && (proofPriceList.length < proofPriceTotal)" class="mb-2">
<v-col align="center">
<v-btn size="small" :loading="loading" @click="getProofPrices">{{ $t('ProofDetail.LoadMore') }}</v-btn>
</v-col>
Expand Down Expand Up @@ -46,14 +47,14 @@ export default {
},
mounted() {
this.getProof()
this.getProofPrices()
},
methods: {
getProof() {
return api.getProofById(this.proofId)
.then((data) => {
if (data.id) {
this.proof = data
this.getProofPrices()
}
})
},
Expand Down

0 comments on commit 8327fb1

Please sign in to comment.