diff options
author | 6543 <6543@obermui.de> | 2021-03-27 17:45:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 17:45:26 +0100 |
commit | 290cf75f9343a43d9770b1d6f8f3332a23357e27 (patch) | |
tree | 520f9f8616fbff3b43a1808ef2d73af3f2fe534b /routers/api/v1/org | |
parent | f4d27498bdc615605e14f783501e1d1256cd8d22 (diff) | |
download | gitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.tar.gz gitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.zip |
[refactor] Unify the export of user data via API (#15144)
* [refactor] unify how user data is exported via API
* test time via unix timestamp
Diffstat (limited to 'routers/api/v1/org')
-rw-r--r-- | routers/api/v1/org/member.go | 2 | ||||
-rw-r--r-- | routers/api/v1/org/team.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/org/member.go b/routers/api/v1/org/member.go index 5f0e36386e..09abad2557 100644 --- a/routers/api/v1/org/member.go +++ b/routers/api/v1/org/member.go @@ -32,7 +32,7 @@ func listMembers(ctx *context.APIContext, publicOnly bool) { apiMembers := make([]*api.User, len(members)) for i, member := range members { - apiMembers[i] = convert.ToUser(member, ctx.IsSigned, ctx.User != nil && ctx.User.IsAdmin) + apiMembers[i] = convert.ToUser(member, ctx.User) } ctx.JSON(http.StatusOK, apiMembers) diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index c749751ac4..99bbd9eefe 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -337,7 +337,7 @@ func GetTeamMembers(ctx *context.APIContext) { } members := make([]*api.User, len(team.Members)) for i, member := range team.Members { - members[i] = convert.ToUser(member, ctx.IsSigned, ctx.User.IsAdmin) + members[i] = convert.ToUser(member, ctx.User) } ctx.JSON(http.StatusOK, members) } @@ -380,7 +380,7 @@ func GetTeamMember(ctx *context.APIContext) { ctx.NotFound() return } - ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.IsSigned, ctx.User.IsAdmin)) + ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.User)) } // AddTeamMember api for add a member to a team |