1
0
Fork 0
forked from forgejo/forgejo

Add load functions

Add ReviewID to findComments

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz 2018-05-10 14:48:08 +02:00
parent aeb057755a
commit 2c18552576
No known key found for this signature in database
GPG key ID: 506AEEBE80BEDECD
2 changed files with 48 additions and 7 deletions

View file

@ -661,10 +661,11 @@ func GetCommentByID(id int64) (*Comment, error) {
// FindCommentsOptions describes the conditions to Find comments
type FindCommentsOptions struct {
RepoID int64
IssueID int64
Since int64
Type CommentType
RepoID int64
IssueID int64
ReviewID int64
Since int64
Type CommentType
}
func (opts *FindCommentsOptions) toConds() builder.Cond {
@ -675,6 +676,9 @@ func (opts *FindCommentsOptions) toConds() builder.Cond {
if opts.IssueID > 0 {
cond = cond.And(builder.Eq{"comment.issue_id": opts.IssueID})
}
if opts.ReviewID > 0 {
cond = cond.And(builder.Eq{"comment.review_id": opts.ReviewID})
}
if opts.Since > 0 {
cond = cond.And(builder.Gte{"comment.updated_unix": opts.Since})
}