mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 11:32:36 +08:00
Grafana: Replace magic number with a constant variable in response status (#80132)
* Chore: Replace response status with const var * Apply suggestions from code review Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> * Add net/http import --------- Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
@ -247,7 +247,7 @@ func (hs *HTTPServer) UpdatePluginSetting(c *contextmodel.ReqContext) response.R
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
if _, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID); !exists {
|
||||
return response.Error(404, "Plugin not installed", nil)
|
||||
return response.Error(http.StatusNotFound, "Plugin not installed", nil)
|
||||
}
|
||||
|
||||
cmd.OrgId = c.SignedInUser.GetOrgID()
|
||||
@ -262,7 +262,7 @@ func (hs *HTTPServer) UpdatePluginSetting(c *contextmodel.ReqContext) response.R
|
||||
OrgID: cmd.OrgId,
|
||||
EncryptedSecureJSONData: cmd.EncryptedSecureJsonData,
|
||||
}); err != nil {
|
||||
return response.Error(500, "Failed to update plugin setting", err)
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update plugin setting", err)
|
||||
}
|
||||
|
||||
hs.pluginContextProvider.InvalidateSettingsCache(c.Req.Context(), pluginID)
|
||||
|
Reference in New Issue
Block a user