refactor: img fallback

This commit is contained in:
Net 2024-09-05 16:00:29 +07:00
parent ea7fa6df69
commit 88dd4d9333

View file

@ -4,6 +4,7 @@ import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
import { QTableProps } from 'quasar';
import { baseUrl } from 'src/stores/utils';
import useCustomerStore from 'stores/customer';
import useFlowStore from 'stores/flow';
import useOptionStore from 'stores/options';
@ -248,6 +249,17 @@ watch([customerId, inputSearch, currentStatus], async () => {
style="border-radius: 0 0 40px 40px; position: relative"
>
<q-avatar no-padding size="50px">
<q-img
:src="`${baseUrl}/customer/${customerId}/image`"
class="full-height full-width"
>
<template #error>
<q-img
:src="`${customerType === 'CORP' ? '/images/customer-CORP-avartar.png' : '/images/customer-PERS-avartar.png'}`"
/>
</template>
</q-img>
<img :src="currentCustomerUrlImage ?? '/no-profile.png'" />
</q-avatar>
</q-card-section>