feat: integrate ExpiryDashboard into inventory page (#69)
Some checks failed
Deploy to Coolify / Code Quality (pull_request) Has been cancelled
Deploy to Coolify / Run Tests (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Development (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Production (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Test (pull_request) Has been cancelled
Pull Request Checks / Validate PR (pull_request) Has been cancelled

This commit is contained in:
Pantry Lead Agent
2026-02-25 01:27:27 +00:00
parent 6eb3169be3
commit bf4d365357

View File

@@ -83,6 +83,14 @@
@updated="handleItemUpdated"
/>
<!-- Expiry Dashboard -->
<div class="mb-6">
<InventoryExpiryDashboard
:items="inventoryItems"
@view-item="editingItem = $event"
/>
</div>
<!-- Inventory List -->
<InventoryList
ref="inventoryListRef"
@@ -111,9 +119,21 @@ const inventoryListRef = ref()
const prefilledData = ref<any>(null)
const selectedTagFilters = ref<string[]>([])
const searchQuery = ref('')
const inventoryItems = ref<any[]>([])
// 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()
}
</script>