Plugins: Refactor plugin settings service (#45967)
* tests passing * rename and rejig * move interface to package and rename to Store * new package * add import alias
This commit is contained in:
@@ -22,10 +22,10 @@ type templateData struct {
|
||||
|
||||
// NewApiPluginProxy create a plugin proxy
|
||||
func NewApiPluginProxy(ctx *models.ReqContext, proxyPath string, route *plugins.Route,
|
||||
appID string, cfg *setting.Cfg, store pluginsettings.Service, secretsService secrets.Service) *httputil.ReverseProxy {
|
||||
appID string, cfg *setting.Cfg, pluginSettingsService pluginsettings.Service, secretsService secrets.Service) *httputil.ReverseProxy {
|
||||
director := func(req *http.Request) {
|
||||
query := models.GetPluginSettingByIdQuery{OrgId: ctx.OrgId, PluginId: appID}
|
||||
if err := store.GetPluginSettingById(ctx.Req.Context(), &query); err != nil {
|
||||
if err := pluginSettingsService.GetPluginSettingById(ctx.Req.Context(), &query); err != nil {
|
||||
ctx.JsonApiErr(500, "Failed to fetch plugin settings", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user