mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 07:49:01 +08:00
fix(alertmanager): send empty array instead of nil (#7312)
This commit is contained in:
parent
de53119257
commit
f96a234faa
@ -97,6 +97,11 @@ func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This ensures that the UI receives an empty array instead of null
|
||||||
|
if len(channels) == 0 {
|
||||||
|
channels = make([]*alertmanagertypes.Channel, 0)
|
||||||
|
}
|
||||||
|
|
||||||
render.Success(rw, http.StatusOK, channels)
|
render.Success(rw, http.StatusOK, channels)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user