mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-15 21:24:06 +09:00
Add load functions
Add ReviewID to findComments Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
@ -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})
|
||||
}
|
||||
|
Reference in New Issue
Block a user