fix(dashboard): handle null responses in widget data fetching

This commit is contained in:
Kalana B. Thilakarathna
2026-08-29 20:36:01 +05:30
parent 29f181d5e1
commit cd5acbab76
6 changed files with 10 additions and 10 deletions
@@ -15,8 +15,8 @@ export function TodaySalesWidget() {
const today = new Date().toISOString().split('T')[0]
try {
const res = await sales.list({ from: today, to: today, pageSize: 50, page: 1 })
setItems(res.items)
setTotal(res.total)
setItems(res.items ?? [])
setTotal(res.total ?? 0)
} catch {
// silent
} finally {