diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-15 20:22:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-15 20:22:02 +0800 |
commit | be0f7ff9bf6da5b1642a98ff02f313ba39ee4518 (patch) | |
tree | 88f206e4aedee25b8e67686b97bf1556b125b3ae /routers/api | |
parent | 8b54b58bc589d501c3459f1dbf8ba0b564cdc4e0 (diff) | |
download | gitea-be0f7ff9bf6da5b1642a98ff02f313ba39ee4518.tar.gz gitea-be0f7ff9bf6da5b1642a98ff02f313ba39ee4518.zip |
Fix team user api (#8172)
* fix team user api
* fix tests
* fix api
* fix team user api
* change user convert
* fix tests
* fix tests
Diffstat (limited to 'routers/api')
-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)) } |