diff --git a/app/pages/index.vue b/app/pages/index.vue
index 75cea09..d71f6e2 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -83,6 +83,14 @@
@updated="handleItemUpdated"
/>
+
+
+
+
+
(null)
const selectedTagFilters = ref([])
const searchQuery = ref('')
+const inventoryItems = ref([])
+
+// Load inventory for dashboard
+const { getInventory } = useInventory()
+
+const loadInventoryData = async () => {
+ const { data } = await getInventory()
+ inventoryItems.value = data || []
+}
// Handle scan-to-add flow (Issue #25)
-onMounted(() => {
+onMounted(async () => {
+ // Load inventory for dashboard
+ await loadInventoryData()
+
if (route.query.action === 'add') {
// Pre-fill data from query params (from scan)
prefilledData.value = {
@@ -136,15 +156,17 @@ const handleCloseAddForm = () => {
prefilledData.value = null
}
-const handleItemAdded = (item: any) => {
+const handleItemAdded = async (item: any) => {
showAddForm.value = false
prefilledData.value = null
- // Reload the inventory list
+ // Reload the inventory list and dashboard
inventoryListRef.value?.reload()
+ await loadInventoryData()
}
-const handleItemUpdated = (item: any) => {
+const handleItemUpdated = async (item: any) => {
editingItem.value = null
inventoryListRef.value?.reload()
+ await loadInventoryData()
}