fix(dashboard): handle null responses in widget data fetching
This commit is contained in:
@@ -16,7 +16,7 @@ export function StockAlertsWidget() {
|
||||
setLoading(true)
|
||||
try {
|
||||
const res = await stock.balances({ pageSize: 100, page: 1 })
|
||||
const low = res.items.filter(b => b.quantity <= LOW_STOCK_THRESHOLD)
|
||||
const low = (res.items ?? []).filter(b => b.quantity <= LOW_STOCK_THRESHOLD)
|
||||
setAlerts(low)
|
||||
} catch {
|
||||
// silent
|
||||
|
||||
Reference in New Issue
Block a user