Provide Default messages for merges (#9393)

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
zeripath 2019-12-30 23:34:11 +00:00 committed by techknowlogick
parent b983ff4473
commit 0c07f1de5b
7 changed files with 276 additions and 15 deletions

View file

@ -125,9 +125,10 @@ func GetReviewByID(id int64) (*Review, error) {
// FindReviewOptions represent possible filters to find reviews
type FindReviewOptions struct {
Type ReviewType
IssueID int64
ReviewerID int64
Type ReviewType
IssueID int64
ReviewerID int64
OfficialOnly bool
}
func (opts *FindReviewOptions) toCond() builder.Cond {
@ -141,6 +142,9 @@ func (opts *FindReviewOptions) toCond() builder.Cond {
if opts.Type != ReviewTypeUnknown {
cond = cond.And(builder.Eq{"type": opts.Type})
}
if opts.OfficialOnly {
cond = cond.And(builder.Eq{"official": true})
}
return cond
}