mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(api): fix empty response for alertList.json
This commit is contained in:
committed by
Łukasz Mierzwa
parent
8c2f1d8a6f
commit
e1505a01cb
@@ -729,7 +729,9 @@ func alertList(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
sort.Strings(sortKeys)
|
||||
|
||||
al := AlertList{}
|
||||
al := AlertList{
|
||||
Alerts: []map[string]string{},
|
||||
}
|
||||
for _, labels := range labelMap {
|
||||
al.Alerts = append(al.Alerts, labels)
|
||||
}
|
||||
|
||||
@@ -3165,6 +3165,12 @@ func TestAlertList(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
args: "q=foo=bar",
|
||||
alerts: AlertList{
|
||||
Alerts: []map[string]string{},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
mockConfig()
|
||||
|
||||
Reference in New Issue
Block a user