diff options
author | Kurt Madel <kmadel@mac.com> | 2016-08-24 23:44:58 -0400 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-08-24 20:44:58 -0700 |
commit | 67fb0fe6a5783f772abfb5438a154435dafff4de (patch) | |
tree | ef53dd2d2312e85aa391dae2e58e5aa5022d305c /routers | |
parent | 0b273ac4d566837b668d9e521476cd94ac28b6d4 (diff) | |
download | gitea-67fb0fe6a5783f772abfb5438a154435dafff4de.tar.gz gitea-67fb0fe6a5783f772abfb5438a154435dafff4de.zip |
added support to set pull_request event from api (#3513)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/hook.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go index 2811a4d29e..3b36055db5 100644 --- a/routers/api/v1/repo/hook.go +++ b/routers/api/v1/repo/hook.go @@ -59,8 +59,9 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) { HookEvent: &models.HookEvent{ ChooseEvents: true, HookEvents: models.HookEvents{ - Create: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE)), - Push: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH)), + Create: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE)), + Push: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH)), + PullRequest: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PULL_REQUEST)), }, }, IsActive: form.Active, @@ -146,6 +147,7 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) { w.ChooseEvents = true w.Create = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE)) w.Push = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH)) + w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PULL_REQUEST)) if err = w.UpdateEvent(); err != nil { ctx.Error(500, "UpdateEvent", err) return |