diff options
author | Emrah URHAN <raxetul@gmail.com> | 2015-11-22 19:40:18 +0200 |
---|---|---|
committer | Emrah URHAN <raxetul@gmail.com> | 2015-11-22 19:40:18 +0200 |
commit | 737da1a3748d7c82af771d3ba4aa4c76ba219eee (patch) | |
tree | b59104944ba28771752adcc1231a847b6704ac4d /routers/api/v1/repo_hooks.go | |
parent | f63a468dfce812423b78a47cfa2583c5ad2faa49 (diff) | |
parent | efaf60ba5a4a7c0954dbaf57203859db3258281f (diff) |
Latest develop updates is merged with my RaspberryPi Dockerfile version.
Merge branch 'develop' of https://github.com/gogits/gogs into develop
Diffstat (limited to 'routers/api/v1/repo_hooks.go')
-rw-r--r-- | routers/api/v1/repo_hooks.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/api/v1/repo_hooks.go b/routers/api/v1/repo_hooks.go index 91547cf1..77c2ba66 100644 --- a/routers/api/v1/repo_hooks.go +++ b/routers/api/v1/repo_hooks.go @@ -44,9 +44,9 @@ func ToApiHook(repoLink string, w *models.Webhook) *api.Hook { // https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks func ListRepoHooks(ctx *middleware.Context) { - hooks, err := models.GetWebhooksByRepoId(ctx.Repo.Repository.ID) + hooks, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID) if err != nil { - ctx.APIError(500, "GetWebhooksByRepoId", err) + ctx.APIError(500, "GetWebhooksByRepoID", err) return } @@ -127,7 +127,11 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) { func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) { w, err := models.GetWebhookByID(ctx.ParamsInt64(":id")) if err != nil { - ctx.APIError(500, "GetWebhookById", err) + if models.IsErrWebhookNotExist(err) { + ctx.Error(404) + } else { + ctx.APIError(500, "GetWebhookById", err) + } return } |