fix logout issue on payment and recurring-invoice view page

This commit is contained in:
radhika587
2023-03-10 18:19:00 +05:30
parent ba298cdb0a
commit bdf8fa8b5a
2 changed files with 20 additions and 75 deletions

View File

@ -22,31 +22,10 @@
<!-- Sidebar --> <!-- Sidebar -->
<div <div
class=" class="fixed top-0 left-0 hidden h-full pt-16 pb-[6rem] ml-56 bg-white xl:ml-64 w-88 xl:block"
fixed
top-0
left-0
hidden
h-full
pt-16
pb-[6rem]
ml-56
bg-white
xl:ml-64
w-88
xl:block
"
> >
<div <div
class=" class="flex items-center justify-between px-4 pt-8 pb-6 border border-gray-200 border-solid"
flex
items-center
justify-between
px-4
pt-8
pb-6
border border-gray-200 border-solid
"
> >
<BaseInput <BaseInput
v-model="searchData.searchText" v-model="searchData.searchText"
@ -70,14 +49,7 @@
</template> </template>
<div <div
class=" class="px-4 py-1 pb-2 mb-2 text-sm border-b border-gray-200 border-solid"
px-4
py-1
pb-2
mb-2
text-sm
border-b border-gray-200 border-solid
"
> >
{{ $t('general.sort_by') }} {{ $t('general.sort_by') }}
</div> </div>
@ -159,43 +131,17 @@
<BaseText <BaseText
:text="payment?.customer?.name" :text="payment?.customer?.name"
:length="30" :length="30"
class=" class="pr-2 mb-2 text-sm not-italic font-normal leading-5 text-black capitalize truncate"
pr-2
mb-2
text-sm
not-italic
font-normal
leading-5
text-black
capitalize
truncate
"
/> />
<div <div
class=" class="mb-1 text-xs not-italic font-medium leading-5 text-gray-500 capitalize"
mb-1
text-xs
not-italic
font-medium
leading-5
text-gray-500
capitalize
"
> >
{{ payment?.payment_number }} {{ payment?.payment_number }}
</div> </div>
<div <div
class=" class="mb-1 text-xs not-italic font-medium leading-5 text-gray-500 capitalize"
mb-1
text-xs
not-italic
font-medium
leading-5
text-gray-500
capitalize
"
> >
{{ payment?.invoice_number }} {{ payment?.invoice_number }}
</div> </div>
@ -203,15 +149,7 @@
<div class="flex-1 whitespace-nowrap right"> <div class="flex-1 whitespace-nowrap right">
<BaseFormatMoney <BaseFormatMoney
class=" class="block mb-2 text-xl not-italic font-semibold leading-8 text-right text-gray-900"
block
mb-2
text-xl
not-italic
font-semibold
leading-8
text-right text-gray-900
"
:amount="payment?.amount" :amount="payment?.amount"
:currency="payment.customer?.currency" :currency="payment.customer?.currency"
/> />
@ -313,9 +251,14 @@ const paymentDate = computed(() => {
) )
}) })
watch(route, () => { const paymentId = computed(() => route.params.id)
loadPayment()
}) watch(
() => paymentId.value,
(id) => {
if (id && route.name === 'payments.view') loadPayment()
}
)
loadPayments() loadPayments()
loadPayment() loadPayment()

View File

@ -78,10 +78,12 @@ let isLoading = computed(() => {
return recurringInvoiceStore.isFetchingViewData return recurringInvoiceStore.isFetchingViewData
}) })
const invoiceId = computed(() => route.params.id)
watch( watch(
route, () => invoiceId.value,
() => { (id) => {
if (route.params.id && route.name === 'recurring-invoices.view') { if (id && route.name === 'recurring-invoices.view') {
loadRecurringInvoice() loadRecurringInvoice()
} }
}, },