rename Context to ReqContext
This commit is contained in:
+5
-5
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
// POST /api/teams
|
||||
func CreateTeam(c *m.Context, cmd m.CreateTeamCommand) Response {
|
||||
func CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Response {
|
||||
cmd.OrgId = c.OrgId
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
if err == m.ErrTeamNameTaken {
|
||||
@@ -24,7 +24,7 @@ func CreateTeam(c *m.Context, cmd m.CreateTeamCommand) Response {
|
||||
}
|
||||
|
||||
// PUT /api/teams/:teamId
|
||||
func UpdateTeam(c *m.Context, cmd m.UpdateTeamCommand) Response {
|
||||
func UpdateTeam(c *m.ReqContext, cmd m.UpdateTeamCommand) Response {
|
||||
cmd.OrgId = c.OrgId
|
||||
cmd.Id = c.ParamsInt64(":teamId")
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
@@ -38,7 +38,7 @@ func UpdateTeam(c *m.Context, cmd m.UpdateTeamCommand) Response {
|
||||
}
|
||||
|
||||
// DELETE /api/teams/:teamId
|
||||
func DeleteTeamById(c *m.Context) Response {
|
||||
func DeleteTeamById(c *m.ReqContext) Response {
|
||||
if err := bus.Dispatch(&m.DeleteTeamCommand{OrgId: c.OrgId, Id: c.ParamsInt64(":teamId")}); err != nil {
|
||||
if err == m.ErrTeamNotFound {
|
||||
return ApiError(404, "Failed to delete Team. ID not found", nil)
|
||||
@@ -49,7 +49,7 @@ func DeleteTeamById(c *m.Context) Response {
|
||||
}
|
||||
|
||||
// GET /api/teams/search
|
||||
func SearchTeams(c *m.Context) Response {
|
||||
func SearchTeams(c *m.ReqContext) Response {
|
||||
perPage := c.QueryInt("perpage")
|
||||
if perPage <= 0 {
|
||||
perPage = 1000
|
||||
@@ -82,7 +82,7 @@ func SearchTeams(c *m.Context) Response {
|
||||
}
|
||||
|
||||
// GET /api/teams/:teamId
|
||||
func GetTeamById(c *m.Context) Response {
|
||||
func GetTeamById(c *m.ReqContext) Response {
|
||||
query := m.GetTeamByIdQuery{OrgId: c.OrgId, Id: c.ParamsInt64(":teamId")}
|
||||
|
||||
if err := bus.Dispatch(&query); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user