From a26ab9f60314420aad1c7d2a328d299f503532fa Mon Sep 17 00:00:00 2001
From: Vidhu Kant Sharma <vidhukant@vidhukant.com>
Date: Sun, 11 Feb 2024 12:43:13 +0530
Subject: removed annoying notifications on HTTP 204

---
 src/components/invoice_header_editor.vue | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src/components/invoice_header_editor.vue')

diff --git a/src/components/invoice_header_editor.vue b/src/components/invoice_header_editor.vue
index ffc5fb0..83c5281 100644
--- a/src/components/invoice_header_editor.vue
+++ b/src/components/invoice_header_editor.vue
@@ -27,8 +27,6 @@ const getAllCustomers = async () => {
     const r = await axios.get('/customer')
     if (r.status === 200) {
       allCustomers.value = r.data.data
-    } else if (r.status === 204) {
-      toast.warning('No customers found')
     }
   } catch (err) {
     toast.error('An unhandled exception occoured. Please check logs')
@@ -129,7 +127,8 @@ onMounted(() => {
         aria-label="Select Brand"
         id="item-brand-input"
       >
-        <option selected disabled value="null">Select Customer</option>
+        <option v-if="allCustomers.length === 0" selected disabled value="null">No customers added in OpenBills!</option>
+        <option v-else selected disabled value="null">Select Customer</option>
         <option v-for="customer in allCustomers" :value="customer" :key="customer['id']">
           {{ customer["Name"] }}
         </option>
-- 
cgit v1.2.3

