diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/org/team.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 3357c07251..7b8fd12fba 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -287,6 +287,15 @@ func GetTeamMember(ctx *context.APIContext) { if ctx.Written() { return } + teamID := ctx.ParamsInt64("teamid") + isTeamMember, err := models.IsUserInTeams(u.ID, []int64{teamID}) + if err != nil { + ctx.Error(500, "IsUserInTeams", err) + return + } else if !isTeamMember { + ctx.NotFound() + return + } ctx.JSON(200, convert.ToUser(u, ctx.IsSigned, ctx.User.IsAdmin)) } |