diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-05-21 20:48:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 20:48:28 +0800 |
commit | 64f6a5d113da0d5d187752c9398d6e8d22d24b79 (patch) | |
tree | f72aea0c5c32d6ee4df1c973eaf67f1058f0f1a1 /routers/api/v1 | |
parent | edd8ea0b0d07f7fee0f8cf506975c8f3bec690ca (diff) | |
download | gitea-64f6a5d113da0d5d187752c9398d6e8d22d24b79.tar.gz gitea-64f6a5d113da0d5d187752c9398d6e8d22d24b79.zip |
Use `CommentList` instead of `[]*Comment` (#24828)
As title.
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/repo/issue_comment.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index 7c8f30f116..5616e255ad 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -90,12 +90,12 @@ func ListIssueComments(ctx *context.APIContext) { return } - if err := issues_model.CommentList(comments).LoadPosters(ctx); err != nil { + if err := comments.LoadPosters(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadPosters", err) return } - if err := issues_model.CommentList(comments).LoadAttachments(ctx); err != nil { + if err := comments.LoadAttachments(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadAttachments", err) return } @@ -182,7 +182,7 @@ func ListIssueCommentsAndTimeline(ctx *context.APIContext) { return } - if err := issues_model.CommentList(comments).LoadPosters(ctx); err != nil { + if err := comments.LoadPosters(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadPosters", err) return } @@ -285,25 +285,25 @@ func ListRepoIssueComments(ctx *context.APIContext) { return } - if err = issues_model.CommentList(comments).LoadPosters(ctx); err != nil { + if err = comments.LoadPosters(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadPosters", err) return } apiComments := make([]*api.Comment, len(comments)) - if err := issues_model.CommentList(comments).LoadIssues(ctx); err != nil { + if err := comments.LoadIssues(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadIssues", err) return } - if err := issues_model.CommentList(comments).LoadPosters(ctx); err != nil { + if err := comments.LoadPosters(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadPosters", err) return } - if err := issues_model.CommentList(comments).LoadAttachments(ctx); err != nil { + if err := comments.LoadAttachments(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadAttachments", err) return } - if _, err := issues_model.CommentList(comments).Issues().LoadRepositories(ctx); err != nil { + if _, err := comments.Issues().LoadRepositories(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "LoadRepositories", err) return } |