summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/issue_comment.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/issue_comment.go')
-rw-r--r--routers/api/v1/repo/issue_comment.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go
index 3af0290585..a3fc6f41f3 100644
--- a/routers/api/v1/repo/issue_comment.go
+++ b/routers/api/v1/repo/issue_comment.go
@@ -51,7 +51,7 @@ func ListIssueComments(ctx *context.APIContext) {
}
// comments,err:=models.GetCommentsByIssueIDSince(, since)
- issue, err := models.GetRawIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
+ issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
if err != nil {
ctx.Error(500, "GetRawIssueByIndex", err)
return
@@ -68,6 +68,10 @@ func ListIssueComments(ctx *context.APIContext) {
}
apiComments := make([]*api.Comment, len(comments))
+ if err = models.CommentList(comments).LoadPosters(); err != nil {
+ ctx.Error(500, "LoadPosters", err)
+ return
+ }
for i := range comments {
apiComments[i] = comments[i].APIFormat()
}
@@ -114,6 +118,11 @@ func ListRepoIssueComments(ctx *context.APIContext) {
return
}
+ if err = models.CommentList(comments).LoadPosters(); err != nil {
+ ctx.Error(500, "LoadPosters", err)
+ return
+ }
+
apiComments := make([]*api.Comment, len(comments))
for i := range comments {
apiComments[i] = comments[i].APIFormat()