diff options
Diffstat (limited to 'models/review.go')
-rw-r--r-- | models/review.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/models/review.go b/models/review.go index 493959e78e..bc7dfbcd14 100644 --- a/models/review.go +++ b/models/review.go @@ -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 } |