forked from forgejo/forgejo
Fix broken migration on webhook (#13911)
* Fix broken migration on webhook * Fix lint Co-authored-by: John Olheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
18e4477ad4
commit
6edfa6bc88
8 changed files with 98 additions and 37 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue