aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/repo/hooks.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-11 11:56:52 -0500
committerUnknwon <u@gogs.io>2016-03-11 11:56:52 -0500
commit514382e2ebfe6869268aeb919c1fa4d224687e13 (patch)
tree1aa8c4b3b1e771a5dc6f0bdd74567961570efcaa /routers/api/v1/repo/hooks.go
parentcb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff)
Rename module: middleware -> context
Diffstat (limited to 'routers/api/v1/repo/hooks.go')
-rw-r--r--routers/api/v1/repo/hooks.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/hooks.go b/routers/api/v1/repo/hooks.go
index e0893a01..954e36be 100644
--- a/routers/api/v1/repo/hooks.go
+++ b/routers/api/v1/repo/hooks.go
@@ -12,12 +12,12 @@ import (
api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/models"
- "github.com/gogits/gogs/modules/middleware"
+ "github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/routers/api/v1/convert"
)
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks
-func ListHooks(ctx *middleware.Context) {
+func ListHooks(ctx *context.Context) {
hooks, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID)
if err != nil {
ctx.APIError(500, "GetWebhooksByRepoID", err)
@@ -33,7 +33,7 @@ func ListHooks(ctx *middleware.Context) {
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#create-a-hook
-func CreateHook(ctx *middleware.Context, form api.CreateHookOption) {
+func CreateHook(ctx *context.Context, form api.CreateHookOption) {
if !models.IsValidHookTaskType(form.Type) {
ctx.APIError(422, "", "Invalid hook type")
return
@@ -98,7 +98,7 @@ func CreateHook(ctx *middleware.Context, form api.CreateHookOption) {
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#edit-a-hook
-func EditHook(ctx *middleware.Context, form api.EditHookOption) {
+func EditHook(ctx *context.Context, form api.EditHookOption) {
w, err := models.GetWebhookByID(ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrWebhookNotExist(err) {