summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/issue/assignee.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/services/issue/assignee.go b/services/issue/assignee.go
index 281f824da7..9711de4c60 100644
--- a/services/issue/assignee.go
+++ b/services/issue/assignee.go
@@ -51,3 +51,23 @@ func ToggleAssignee(issue *models.Issue, doer *models.User, assigneeID int64) (r
return
}
+
+// ReviewRequest add or remove a review for this PR, and make comment for it.
+func ReviewRequest(issue *models.Issue, doer *models.User, reviewer *models.User, isAdd bool) (err error) {
+ var comment *models.Comment
+ if isAdd {
+ comment, err = models.AddRewiewRequest(issue, reviewer, doer)
+ } else {
+ comment, err = models.RemoveRewiewRequest(issue, reviewer, doer)
+ }
+
+ if err != nil {
+ return
+ }
+
+ if comment != nil {
+ notification.NotifyPullRewiewRequest(doer, issue, reviewer, isAdd, comment)
+ }
+
+ return nil
+}