From 64f6a5d113da0d5d187752c9398d6e8d22d24b79 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 21 May 2023 20:48:28 +0800 Subject: Use `CommentList` instead of `[]*Comment` (#24828) As title. --- routers/api/v1/repo/issue_comment.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'routers/api') 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 } -- cgit v1.2.3