forked from forgejo/forgejo
Add load functions
Add ReviewID to findComments Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
parent
aeb057755a
commit
2c18552576
2 changed files with 48 additions and 7 deletions
|
@ -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})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue