summaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/review.go b/models/review.go
index 0dc44a2a4c..fb989b2b35 100644
--- a/models/review.go
+++ b/models/review.go
@@ -223,6 +223,11 @@ func getCurrentReview(e Engine, reviewer *User, issue *Issue) (*Review, error) {
return reviews[0], nil
}
+// ReviewExists returns whether a review exists for a particular line of code in the PR
+func ReviewExists(issue *Issue, treePath string, line int64) (bool, error) {
+ return x.Cols("id").Exist(&Comment{IssueID: issue.ID, TreePath: treePath, Line: line, Type: CommentTypeCode})
+}
+
// GetCurrentReview returns the current pending review of reviewer for given issue
func GetCurrentReview(reviewer *User, issue *Issue) (*Review, error) {
return getCurrentReview(x, reviewer, issue)