diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-04 15:26:36 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-04 15:26:36 +0530 |
commit | 331a8da55352c736f08339ae6ca0d9e0eb690058 (patch) | |
tree | eebd21abc445d1f05a681668d1d66bbaa6034e98 /src/views | |
parent | d5fab4fefaa3e63c1cda945cf556a0ecfdfa0170 (diff) |
added table to show items of an invoice0.2.2
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/EditInvoice.vue | 7 | ||||
-rw-r--r-- | src/views/HomeView.vue | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/views/EditInvoice.vue b/src/views/EditInvoice.vue index b134721..7a508f8 100644 --- a/src/views/EditInvoice.vue +++ b/src/views/EditInvoice.vue @@ -8,6 +8,7 @@ import Invoice from "./../classes/invoice" import invoiceHeader from './../components/invoice_header.vue' import itemSelector from './../components/item_selector.vue' +import invoiceItemsTable from './../components/invoice_items_table.vue' const toast = useToast({ position: 'top-right' @@ -15,6 +16,7 @@ const toast = useToast({ const route = useRoute() +const invoiceId = route.params.id const invoice = ref(new Invoice()) const isLoading = ref(true) @@ -22,7 +24,7 @@ const getInvoice = async () => { isLoading.value = true try { - const r = await axios.get(`/invoice/${route.params.id}`) + const r = await axios.get(`/invoice/${invoiceId}`) invoice.value = r.data.data } catch (err) { toast.error('An unhandled exception occoured. Please check logs') @@ -43,5 +45,6 @@ onMounted(() => { <template> <invoiceHeader :invoice="invoice" /> - <itemSelector :invoice="invoice" @added="refreshItems()"/> + <itemSelector :invoiceId="invoiceId" @added="refreshItems()"/> + <invoiceItemsTable :invoiceId="invoiceId" /> </template> diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 0a5bf4d..6ef6440 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -16,7 +16,7 @@ const getAllDrafts = async () => { allDrafts.value = res.data.data } } catch (err) { - toast.error('An unhandled exception occoured. Please check logs') + //toast.error('An unhandled exception occoured. Please check logs') console.error(err) } |