1
0
Fork 0
forked from forgejo/forgejo

more APIs on #12

This commit is contained in:
Unknwon 2014-11-18 11:07:16 -05:00
parent db0026c507
commit 37d8d3afe9
10 changed files with 108 additions and 24 deletions

View file

@ -107,9 +107,21 @@ func CreateRepoHook(ctx *middleware.Context, form CreateRepoHookForm) {
return
}
ctx.JSON(201, map[string]interface{}{
"ok": true,
})
apiHook := &api.Hook{
Id: w.Id,
Type: w.HookTaskType.Name(),
Events: []string{"push"},
Active: w.IsActive,
Config: map[string]string{
"url": w.Url,
"content_type": w.ContentType.Name(),
},
}
if w.HookTaskType == models.SLACK {
s := w.GetSlackHook()
apiHook.Config["channel"] = s.Channel
}
ctx.JSON(201, apiHook)
}
type EditRepoHookForm struct {