Alerting: time interval service to support addressing intervals by Base64 encoded name (#90563)
* rename to getMuteTimingByName * add UID to api model of MuteTiming * update GetMuteTiming to search by UID * update UpdateMuteTiming to support search by UID * update DeleteMuteTiming to support uid * make sure UID is populated * update usages * use base64 url-safe, no padding encoding for UID
This commit is contained in:
@@ -298,7 +298,14 @@ func (srv *ProvisioningSrv) RoutePostMuteTiming(c *contextmodel.ReqContext, mt d
|
||||
}
|
||||
|
||||
func (srv *ProvisioningSrv) RoutePutMuteTiming(c *contextmodel.ReqContext, mt definitions.MuteTimeInterval, name string) response.Response {
|
||||
mt.Name = name
|
||||
// if body does not specify name, assume that the path contains the name
|
||||
if mt.Name == "" {
|
||||
mt.Name = name
|
||||
}
|
||||
// if body contains a name, and it's different from the one in the path, assume the latter to be UID
|
||||
if mt.Name != name {
|
||||
mt.UID = name
|
||||
}
|
||||
mt.Provenance = determineProvenance(c)
|
||||
updated, err := srv.muteTimings.UpdateMuteTiming(c.Req.Context(), mt, c.SignedInUser.GetOrgID())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user