refactor: handle undefined stats in credit note display

This commit is contained in:
puriphatt 2025-02-19 16:26:46 +07:00
parent 7be89d1d4f
commit 453252c4be

View file

@ -157,7 +157,7 @@ watch(
color: hsl(var(--info-bg));
"
>
{{ pageState.total }}
{{ stats.Pending + stats.Success || 0 }}
</q-badge>
<q-btn
class="q-ml-sm"
@ -181,13 +181,13 @@ watch(
:branch="[
{
icon: 'material-symbols-light:receipt-long',
count: stats[CreditNoteStatus.Pending],
count: stats[CreditNoteStatus.Pending] || 0,
label: `creditNote.stats.${CreditNoteStatus.Pending}`,
color: 'orange',
},
{
icon: 'mdi-check-decagram-outline',
count: stats[CreditNoteStatus.Success],
count: stats[CreditNoteStatus.Success] || 0,
label: `creditNote.stats.${CreditNoteStatus.Success}`,
color: 'blue',
},