[fix] force load picture not from cache

This commit is contained in:
Tim Gröger 2021-11-15 21:11:21 +01:00
parent b0c3eeb6fc
commit bcb661cc3f
2 changed files with 9 additions and 4 deletions

View File

@ -557,7 +557,9 @@ export default defineComponent({
function image(id: number | undefined) { function image(id: number | undefined) {
if (id) { if (id) {
return `${api.defaults.baseURL || ''}/pricelist/drinks/${id}/picture?thumbnail`; return `${
api.defaults.baseURL || ''
}/pricelist/drinks/${id}/picture?thumbnail?t=${new Date()}`;
} }
return 'no-image.svg'; return 'no-image.svg';
} }

View File

@ -138,7 +138,8 @@
</q-card-section> </q-card-section>
<q-card-actions class="justify-around"> <q-card-actions class="justify-around">
<q-btn label="Abbrechen" @click="cancel" /> <q-btn label="Abbrechen" @click="cancel" />
<q-btn v-if="can_delete" label="Löschen" color="negative" @click="delete_drink" /> <!--<q-btn v-if="can_delete" label="Löschen" color="negative" @click="delete_drink" />-->
<q-btn label="Löschen" color="negative" @click="delete_drink" />
<q-btn label="Speichern" color="primary" @click="save" /> <q-btn label="Speichern" color="primary" @click="save" />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
@ -266,7 +267,7 @@ export default defineComponent({
} }
const image = computed(() => { const image = computed(() => {
console.log(imgsrc.value, deletePic.value, edit_drink.value) console.log(imgsrc.value, deletePic.value, edit_drink.value);
if (deletePic.value) { if (deletePic.value) {
return 'no-image.svg'; return 'no-image.svg';
} }
@ -274,7 +275,9 @@ export default defineComponent({
return <string>imgsrc.value; return <string>imgsrc.value;
} }
if (edit_drink.value?.has_image) { if (edit_drink.value?.has_image) {
return `${api.defaults.baseURL || ''}/pricelist/drinks/${edit_drink.value.id}/picture?thumbnail`; return `${api.defaults.baseURL || ''}/pricelist/drinks/${
edit_drink.value.id
}/picture?thumbnail?t=${new Date()}`;
} }
return 'no-image.svg'; return 'no-image.svg';
}); });