summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-06-21 09:00:44 +0800
committerGitHub <noreply@github.com>2017-06-21 09:00:44 +0800
commitd71fad2ab7afc5d1bfa17842b1a66c9d1d274167 (patch)
tree3329afa9684d6bdc2f852743f7b2f85e931f51ec /routers
parent0a5dc640a12d1c0475052b73a721056b53460275 (diff)
downloadgitea-d71fad2ab7afc5d1bfa17842b1a66c9d1d274167.tar.gz
gitea-d71fad2ab7afc5d1bfa17842b1a66c9d1d274167.zip
Fix #2001 and fix issue comments hidden (#2016)
* revert #2001 and fix issue comments hidden * fix #2001 * fix import * improve comment type * reduce unnecessary join * fix comment on FindCommentsOptions
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/issue_comment.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go
index 13e3ec6ab8..b57511a2de 100644
--- a/routers/api/v1/repo/issue_comment.go
+++ b/routers/api/v1/repo/issue_comment.go
@@ -27,7 +27,11 @@ func ListIssueComments(ctx *context.APIContext) {
return
}
- comments, err := models.GetCommentsByIssueIDSince(issue.ID, since.Unix())
+ comments, err := models.FindComments(models.FindCommentsOptions{
+ IssueID: issue.ID,
+ Since: since.Unix(),
+ Type: models.CommentTypeComment,
+ })
if err != nil {
ctx.Error(500, "GetCommentsByIssueIDSince", err)
return
@@ -47,7 +51,11 @@ func ListRepoIssueComments(ctx *context.APIContext) {
since, _ = time.Parse(time.RFC3339, ctx.Query("since"))
}
- comments, err := models.GetCommentsByRepoIDSince(ctx.Repo.Repository.ID, since.Unix())
+ comments, err := models.FindComments(models.FindCommentsOptions{
+ RepoID: ctx.Repo.Repository.ID,
+ Since: since.Unix(),
+ Type: models.CommentTypeComment,
+ })
if err != nil {
ctx.Error(500, "GetCommentsByRepoIDSince", err)
return