mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 00:45:22 +02:00
[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>
This commit is contained in:
parent
b7ffc6a096
commit
0b3aaa6196
5 changed files with 73 additions and 14 deletions
|
@ -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})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue