fix: expenses without tag crashes reports page
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m18s

This commit is contained in:
juancwu 2026-02-14 17:30:13 +00:00
commit cbb14ffba2
2 changed files with 2 additions and 2 deletions

View file

@ -47,6 +47,6 @@ type ExpenseItem struct {
type TagExpenseSummary struct {
TagID string `db:"tag_id"`
TagName string `db:"tag_name"`
TagColor string `db:"tag_color"`
TagColor *string `db:"tag_color"`
TotalAmount int `db:"total_amount"`
}

View file

@ -98,7 +98,7 @@ templ ReportCharts(spaceID string, report *model.SpendingReport, from, to time.T
for i, t := range report.ByTag {
tagLabels[i] = t.TagName
tagData[i] = float64(t.TotalAmount) / 100.0
tagColors[i] = chartColor(i, &t.TagColor)
tagColors[i] = chartColor(i, t.TagColor)
}
}}
@chart.Chart(chart.Props{