aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-26 21:45:51 +0800
committerUnknwon <u@gogs.io>2015-08-26 21:45:51 +0800
commit28814564212b7c64136cc3eda3774af56983557e (patch)
treec0ea1c8ecb6504241a1d2b4111075ee2b0905470 /routers/api
parent1cb03135b745675e614b0b89ab3fde412276fec1 (diff)
downloadgitea-28814564212b7c64136cc3eda3774af56983557e.tar.gz
gitea-28814564212b7c64136cc3eda3774af56983557e.zip
new webhooks list UI
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo_hooks.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/api/v1/repo_hooks.go b/routers/api/v1/repo_hooks.go
index 0348c68391..eb1c4be447 100644
--- a/routers/api/v1/repo_hooks.go
+++ b/routers/api/v1/repo_hooks.go
@@ -26,7 +26,7 @@ func ListRepoHooks(ctx *middleware.Context) {
apiHooks := make([]*api.Hook, len(hooks))
for i := range hooks {
h := &api.Hook{
- Id: hooks[i].Id,
+ ID: hooks[i].ID,
Type: hooks[i].HookTaskType.Name(),
Active: hooks[i].IsActive,
Config: make(map[string]string),
@@ -35,7 +35,7 @@ func ListRepoHooks(ctx *middleware.Context) {
// Currently, onle have push event.
h.Events = []string{"push"}
- h.Config["url"] = hooks[i].Url
+ h.Config["url"] = hooks[i].URL
h.Config["content_type"] = hooks[i].ContentType.Name()
if hooks[i].HookTaskType == models.SLACK {
s := hooks[i].GetSlackHook()
@@ -67,8 +67,8 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
}
w := &models.Webhook{
- RepoId: ctx.Repo.Repository.ID,
- Url: form.Config["url"],
+ RepoID: ctx.Repo.Repository.ID,
+ URL: form.Config["url"],
ContentType: models.ToHookContentType(form.Config["content_type"]),
Secret: form.Config["secret"],
HookEvent: &models.HookEvent{
@@ -102,12 +102,12 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
}
apiHook := &api.Hook{
- Id: w.Id,
+ ID: w.ID,
Type: w.HookTaskType.Name(),
Events: []string{"push"},
Active: w.IsActive,
Config: map[string]string{
- "url": w.Url,
+ "url": w.URL,
"content_type": w.ContentType.Name(),
},
}
@@ -129,7 +129,7 @@ func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
if form.Config != nil {
if url, ok := form.Config["url"]; ok {
- w.Url = url
+ w.URL = url
}
if ct, ok := form.Config["content_type"]; ok {
if !models.IsValidHookContentType(ct) {