mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
more APIs on #12
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user