summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/utils/hook.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/utils/hook.go')
-rw-r--r--routers/api/v1/utils/hook.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/utils/hook.go b/routers/api/v1/utils/hook.go
index 85af6c8e6a..c8471184f5 100644
--- a/routers/api/v1/utils/hook.go
+++ b/routers/api/v1/utils/hook.go
@@ -132,10 +132,10 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID
},
BranchFilter: form.BranchFilter,
},
- IsActive: form.Active,
- HookTaskType: models.HookTaskType(form.Type),
+ IsActive: form.Active,
+ Type: models.HookTaskType(form.Type),
}
- if w.HookTaskType == models.SLACK {
+ if w.Type == models.SLACK {
channel, ok := form.Config["channel"]
if !ok {
ctx.Error(http.StatusUnprocessableEntity, "", "Missing config option: channel")
@@ -219,7 +219,7 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho
w.ContentType = models.ToHookContentType(ct)
}
- if w.HookTaskType == models.SLACK {
+ if w.Type == models.SLACK {
if channel, ok := form.Config["channel"]; ok {
meta, err := json.Marshal(&webhook.SlackMeta{
Channel: channel,