aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--src/components/sidebar.vue4
-rw-r--r--src/views/HomeView.vue36
3 files changed, 36 insertions, 6 deletions
diff --git a/package.json b/package.json
index 5e3e9af..fbd1a52 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "openbills-web",
- "version": "0.2.0",
+ "version": "0.2.1",
"private": false,
"scripts": {
"dev": "vite",
diff --git a/src/components/sidebar.vue b/src/components/sidebar.vue
index d9c05d5..4c4623f 100644
--- a/src/components/sidebar.vue
+++ b/src/components/sidebar.vue
@@ -11,10 +11,6 @@ watch(
requiresAuth.value = route.meta.isAuth
}
)
-console.log(toRaw(route.fullPath))
-console.log(toRaw(route.fullPath))
-console.log(toRaw(route.fullPath))
-console.log(toRaw(route.name))
</script>
<template>
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 6b087a7..0a5bf4d 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -1,5 +1,39 @@
-<script setup lang="ts"></script>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue'
+import { RouterLink } from 'vue-router'
+import axios from 'axios'
+
+const isLoading = ref(false)
+const allDrafts = ref([])
+
+const getAllDrafts = async () => {
+ allDrafts.value = []
+ isLoading.value = true
+
+ try {
+ const res = await axios.get('/invoice/draft')
+ if (res.status === 200) {
+ allDrafts.value = res.data.data
+ }
+ } catch (err) {
+ toast.error('An unhandled exception occoured. Please check logs')
+ console.error(err)
+ }
+
+ isLoading.value = false
+}
+
+onMounted(() => {
+ getAllDrafts()
+})
+</script>
<template>
<h1>OpenBills Home Page</h1>
+ <h2>Draft Invoices:</h2>
+ <ul>
+ <li v-for="draft in allDrafts" :key="draft['ID']">
+ <RouterLink :to="{path: `/invoice/edit-draft/${draft['ID']}`}">Invoice Number {{ draft["InvoiceNumber"] }}</RouterLink>
+ </li>
+ </ul>
</template>