From 2807274e2dca1780443bcbbab946b1551c4c88f5 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 19 Mar 2017 17:44:46 -0400 Subject: repo/webhook: able to retrigger delivery history (#2187) --- routers/api/v1/repo/hook.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'routers/api/v1/repo/hook.go') diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go index ca8817dc..1fcd8735 100644 --- a/routers/api/v1/repo/hook.go +++ b/routers/api/v1/repo/hook.go @@ -12,6 +12,7 @@ import ( api "github.com/gogits/go-gogs-client" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/modules/context" "github.com/gogits/gogs/routers/api/v1/convert" ) @@ -106,7 +107,7 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) { func EditHook(ctx *context.APIContext, form api.EditHookOption) { w, err := models.GetWebhookOfRepoByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) if err != nil { - if models.IsErrWebhookNotExist(err) { + if errors.IsWebhookNotExist(err) { ctx.Status(404) } else { ctx.Error(500, "GetWebhookOfRepoByID", err) -- cgit v1.2.3