Commit 3f57a81c by Leonard Gram

teams: cleanup.

parent ccfd6789
...@@ -31,16 +31,13 @@ func GetTeamMembers(c *m.ReqContext) Response { ...@@ -31,16 +31,13 @@ func GetTeamMembers(c *m.ReqContext) Response {
// POST /api/teams/:teamId/members // POST /api/teams/:teamId/members
func AddTeamMember(c *m.ReqContext, cmd m.AddTeamMemberCommand) Response { func AddTeamMember(c *m.ReqContext, cmd m.AddTeamMemberCommand) Response {
teamId := c.ParamsInt64(":teamId") cmd.OrgId = c.OrgId
orgId := c.OrgId cmd.TeamId = c.ParamsInt64(":teamId")
if err := teamguardian.CanAdmin(orgId, teamId, c.SignedInUser); err != nil { if err := teamguardian.CanAdmin(cmd.OrgId, cmd.TeamId, c.SignedInUser); err != nil {
return Error(403, "Not allowed to add team member", err) return Error(403, "Not allowed to add team member", err)
} }
cmd.TeamId = teamId
cmd.OrgId = orgId
if err := bus.Dispatch(&cmd); err != nil { if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrTeamNotFound { if err == m.ErrTeamNotFound {
return Error(404, "Team not found", nil) return Error(404, "Team not found", nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment