summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/utils/hook.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-12-10 01:20:13 +0800
committerGitHub <noreply@github.com>2020-12-09 17:20:13 +0000
commit6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7 (patch)
treee6c479d97cbd006c3cc521ec77fde5c0d72b4cc1 /routers/api/v1/utils/hook.go
parent18e4477ad41a8733225d3c92eea5b91c12af1a94 (diff)
downloadgitea-6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7.tar.gz
gitea-6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7.zip
Fix broken migration on webhook (#13911)
* Fix broken migration on webhook * Fix lint Co-authored-by: John Olheiser <john.olheiser@gmail.com>
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,