aboutsummaryrefslogtreecommitdiff
path: root/src/components/customers_table.vue
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2024-02-11 12:43:13 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2024-02-11 12:43:13 +0530
commita26ab9f60314420aad1c7d2a328d299f503532fa (patch)
treec71eac7944bde25a0a4ec383ac3fd5030e7ac61a /src/components/customers_table.vue
parentbc639c89eb5530e7ffeae864ec7fa170e5faccc2 (diff)
removed annoying notifications on HTTP 204
Diffstat (limited to 'src/components/customers_table.vue')
-rw-r--r--src/components/customers_table.vue6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/customers_table.vue b/src/components/customers_table.vue
index 163c6b1..3632291 100644
--- a/src/components/customers_table.vue
+++ b/src/components/customers_table.vue
@@ -19,8 +19,6 @@ const getAllCustomers = async () => {
const res = await axios.get('/customer')
if (res.status === 200) {
allCustomers.value = res.data.data
- } else if (res.status === 204) {
- toast.warning('No records found')
}
} catch (err) {
toast.error('An unhandled exception occoured. Please check logs')
@@ -56,6 +54,10 @@ onMounted(() => {
</div>
</div>
+ <div v-else-if="allCustomers.length === 0" class="w-100 d-flex justify-content-center">
+ <p>No customers added! <RouterLink to="/customer/new">Add new.</RouterLink></p>
+ </div>
+
<table v-else class="table table-striped table-hover">
<thead>
<tr>