1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-17 15:58:36 +00:00

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
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})
}