summaryrefslogtreecommitdiffstats
path: root/services/pull/review.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-02 06:51:22 +0800
committerzeripath <art27@cantab.net>2019-11-01 22:51:22 +0000
commit0e7f7df3cf176640c66ddf286ec052c7c13beb8a (patch)
tree16afa02dd0b3df428aa7d9daadd4796eef907332 /services/pull/review.go
parentba336f6f456835f1f327ee967991079dd220266d (diff)
downloadgitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.tar.gz
gitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.zip
Move webhook to a standalone package under modules (#8747)
* Move webhook to a standalone package under modules * fix test * fix comments
Diffstat (limited to 'services/pull/review.go')
-rw-r--r--services/pull/review.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/pull/review.go b/services/pull/review.go
index 3388e4bb56..cffe5da4dd 100644
--- a/services/pull/review.go
+++ b/services/pull/review.go
@@ -8,6 +8,7 @@ package pull
import (
"code.gitea.io/gitea/models"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/webhook"
)
// CreateReview creates a new review based on opts
@@ -55,7 +56,7 @@ func reviewHook(review *models.Review) error {
if err != nil {
return err
}
- if err := models.PrepareWebhooks(review.Issue.Repo, reviewHookType, &api.PullRequestPayload{
+ if err := webhook.PrepareWebhooks(review.Issue.Repo, reviewHookType, &api.PullRequestPayload{
Action: api.HookIssueSynchronized,
Index: review.Issue.Index,
PullRequest: pr.APIFormat(),
@@ -68,7 +69,7 @@ func reviewHook(review *models.Review) error {
}); err != nil {
return err
}
- go models.HookQueue.Add(review.Issue.Repo.ID)
+ go webhook.HookQueue.Add(review.Issue.Repo.ID)
return nil
}