mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
move Context and session out of middleware
This commit is contained in:
@@ -2,12 +2,11 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
func GetOrgQuotas(c *middleware.Context) Response {
|
||||
func GetOrgQuotas(c *m.Context) Response {
|
||||
if !setting.Quota.Enabled {
|
||||
return ApiError(404, "Quotas not enabled", nil)
|
||||
}
|
||||
@@ -20,7 +19,7 @@ func GetOrgQuotas(c *middleware.Context) Response {
|
||||
return Json(200, query.Result)
|
||||
}
|
||||
|
||||
func UpdateOrgQuota(c *middleware.Context, cmd m.UpdateOrgQuotaCmd) Response {
|
||||
func UpdateOrgQuota(c *m.Context, cmd m.UpdateOrgQuotaCmd) Response {
|
||||
if !setting.Quota.Enabled {
|
||||
return ApiError(404, "Quotas not enabled", nil)
|
||||
}
|
||||
@@ -37,7 +36,7 @@ func UpdateOrgQuota(c *middleware.Context, cmd m.UpdateOrgQuotaCmd) Response {
|
||||
return ApiSuccess("Organization quota updated")
|
||||
}
|
||||
|
||||
func GetUserQuotas(c *middleware.Context) Response {
|
||||
func GetUserQuotas(c *m.Context) Response {
|
||||
if !setting.Quota.Enabled {
|
||||
return ApiError(404, "Quotas not enabled", nil)
|
||||
}
|
||||
@@ -50,7 +49,7 @@ func GetUserQuotas(c *middleware.Context) Response {
|
||||
return Json(200, query.Result)
|
||||
}
|
||||
|
||||
func UpdateUserQuota(c *middleware.Context, cmd m.UpdateUserQuotaCmd) Response {
|
||||
func UpdateUserQuota(c *m.Context, cmd m.UpdateUserQuotaCmd) Response {
|
||||
if !setting.Quota.Enabled {
|
||||
return ApiError(404, "Quotas not enabled", nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user