diff --git a/components/dashboard/promotions/ProductSelector.tsx b/components/dashboard/promotions/ProductSelector.tsx index a0e4422..27bc2b2 100644 --- a/components/dashboard/promotions/ProductSelector.tsx +++ b/components/dashboard/promotions/ProductSelector.tsx @@ -50,7 +50,15 @@ export default function ProductSelector({ setLoading(true); try { const response = await fetchClient('/promotions/products/all'); - setProducts(response); + // Ensure we only set an array to state to avoid runtime errors + if (Array.isArray(response)) { + setProducts(response); + } else if (response && Array.isArray((response as any).products)) { + setProducts((response as any).products); + } else { + console.error('Unexpected products response shape:', response); + setProducts([]); + } } catch (error) { console.error('Error fetching products:', error); } finally { @@ -119,8 +127,8 @@ export default function ProductSelector({ {/* Dropdown using absolute positioning within relative container */} {open && (
{/* Search Header */}
@@ -135,7 +143,7 @@ export default function ProductSelector({
{/* Products List */} - + {loading ? (
Loading products... diff --git a/public/git-info.json b/public/git-info.json index ba3d780..d8bfb67 100644 --- a/public/git-info.json +++ b/public/git-info.json @@ -1,4 +1,4 @@ { - "commitHash": "8554481", - "buildTime": "2025-09-17T17:02:11.044Z" + "commitHash": "74b7aa4", + "buildTime": "2025-09-23T12:09:08.230Z" } \ No newline at end of file