aboutsummaryrefslogtreecommitdiff
path: root/src/components/new_item.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/new_item.vue')
-rw-r--r--src/components/new_item.vue8
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 }}