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/repo/issue_reaction.go | |
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/repo/issue_reaction.go')
-rw-r--r-- | routers/api/v1/repo/issue_reaction.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/repo/issue_reaction.go b/routers/api/v1/repo/issue_reaction.go index 3994c6b941..d0ba8dac65 100644 --- a/routers/api/v1/repo/issue_reaction.go +++ b/routers/api/v1/repo/issue_reaction.go @@ -81,7 +81,7 @@ func GetIssueCommentReactions(ctx *context.APIContext) { var result []api.Reaction for _, r := range reactions { result = append(result, api.Reaction{ - User: convert.ToUser(r.User, ctx.IsSigned, false), + User: convert.ToUser(r.User, ctx.User), Reaction: r.Type, Created: r.CreatedUnix.AsTime(), }) @@ -203,7 +203,7 @@ func changeIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOp ctx.Error(http.StatusForbidden, err.Error(), err) } else if models.IsErrReactionAlreadyExist(err) { ctx.JSON(http.StatusOK, api.Reaction{ - User: convert.ToUser(ctx.User, true, true), + User: convert.ToUser(ctx.User, ctx.User), Reaction: reaction.Type, Created: reaction.CreatedUnix.AsTime(), }) @@ -214,7 +214,7 @@ func changeIssueCommentReaction(ctx *context.APIContext, form api.EditReactionOp } ctx.JSON(http.StatusCreated, api.Reaction{ - User: convert.ToUser(ctx.User, true, true), + User: convert.ToUser(ctx.User, ctx.User), Reaction: reaction.Type, Created: reaction.CreatedUnix.AsTime(), }) @@ -299,7 +299,7 @@ func GetIssueReactions(ctx *context.APIContext) { var result []api.Reaction for _, r := range reactions { result = append(result, api.Reaction{ - User: convert.ToUser(r.User, ctx.IsSigned, false), + User: convert.ToUser(r.User, ctx.User), Reaction: r.Type, Created: r.CreatedUnix.AsTime(), }) @@ -412,7 +412,7 @@ func changeIssueReaction(ctx *context.APIContext, form api.EditReactionOption, i ctx.Error(http.StatusForbidden, err.Error(), err) } else if models.IsErrReactionAlreadyExist(err) { ctx.JSON(http.StatusOK, api.Reaction{ - User: convert.ToUser(ctx.User, true, true), + User: convert.ToUser(ctx.User, ctx.User), Reaction: reaction.Type, Created: reaction.CreatedUnix.AsTime(), }) @@ -423,7 +423,7 @@ func changeIssueReaction(ctx *context.APIContext, form api.EditReactionOption, i } ctx.JSON(http.StatusCreated, api.Reaction{ - User: convert.ToUser(ctx.User, true, true), + User: convert.ToUser(ctx.User, ctx.User), Reaction: reaction.Type, Created: reaction.CreatedUnix.AsTime(), }) |