diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-02-11 12:43:13 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-02-11 12:43:13 +0530 |
commit | a26ab9f60314420aad1c7d2a328d299f503532fa (patch) | |
tree | c71eac7944bde25a0a4ec383ac3fd5030e7ac61a /src/components/new_item.vue | |
parent | bc639c89eb5530e7ffeae864ec7fa170e5faccc2 (diff) |
removed annoying notifications on HTTP 204
Diffstat (limited to 'src/components/new_item.vue')
-rw-r--r-- | src/components/new_item.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/new_item.vue b/src/components/new_item.vue index 8b1f3f6..e93d0ea 100644 --- a/src/components/new_item.vue +++ b/src/components/new_item.vue @@ -10,7 +10,7 @@ const toast = useToast({ const isLoading = ref(true) const item = ref(new Item()) -const itemBrand = ref({ id: 0, name: '' }) +const itemBrand = ref(null) const allBrands = ref([]) const getAllBrands = async () => { @@ -21,8 +21,6 @@ const getAllBrands = async () => { const r = await axios.get('/brand') if (r.status === 200) { allBrands.value = r.data.data - } else if (r.status === 204) { - toast.warning('No brands found') } } catch (err) { toast.error('An unhandled exception occoured. Please check logs') @@ -129,13 +127,15 @@ onMounted(() => { </div> <div class="col-md-3"> <label for="item-brand-input" class="form-label">Brand</label> + <select class="form-select" aria-label="Select Brand" id="item-brand-input" v-model="itemBrand" > - <option selected disabled value="0">Select Brand</option> + <option v-if="allBrands.length == 0" selected disabled value="null">No brands added in OpenBills!</option> + <option v-else selected disabled value="null">Select Brand</option> <option v-for="brand in allBrands" :value="brand" :key="brand.id"> {{ brand.Name }} |