diff options
author | 6543 <6543@obermui.de> | 2020-01-13 17:02:24 +0100 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2020-01-13 17:02:24 +0100 |
commit | 0b3aaa61964faa85b8008b04487388cc362ab436 (patch) | |
tree | cc6a3eda4780b7c8aa2d9e108a8a0ec393fbbb83 /models/issue_comment.go | |
parent | b7ffc6a096bdb231d95ecbb5db878e3d8b2b63c9 (diff) | |
download | gitea-0b3aaa61964faa85b8008b04487388cc362ab436.tar.gz gitea-0b3aaa61964faa85b8008b04487388cc362ab436.zip |
[API] Add "before" query to ListIssueComments and ListRepoIssue… (#9685)
* add "before" query to ListIssueComments and ListRepoIssueComments
* Add TEST
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 9caab1dc45..8f54d9656a 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -782,6 +782,7 @@ type FindCommentsOptions struct { IssueID int64 ReviewID int64 Since int64 + Before int64 Type CommentType } @@ -799,6 +800,9 @@ func (opts *FindCommentsOptions) toConds() builder.Cond { if opts.Since > 0 { cond = cond.And(builder.Gte{"comment.updated_unix": opts.Since}) } + if opts.Before > 0 { + cond = cond.And(builder.Lte{"comment.updated_unix": opts.Before}) + } if opts.Type != CommentTypeUnknown { cond = cond.And(builder.Eq{"comment.type": opts.Type}) } |