aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/setting/webhook.go')
-rw-r--r--routers/web/repo/setting/webhook.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/web/repo/setting/webhook.go b/routers/web/repo/setting/webhook.go
index 1a3549fea4..7661599729 100644
--- a/routers/web/repo/setting/webhook.go
+++ b/routers/web/repo/setting/webhook.go
@@ -99,9 +99,9 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
if ctx.Data["PageIsAdmin"] == true {
return &ownerRepoCtx{
IsAdmin: true,
- IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
+ IsSystemWebhook: ctx.PathParam(":configType") == "system-hooks",
Link: path.Join(setting.AppSubURL, "/admin/hooks"),
- LinkNew: path.Join(setting.AppSubURL, "/admin/", ctx.Params(":configType")),
+ LinkNew: path.Join(setting.AppSubURL, "/admin/", ctx.PathParam(":configType")),
NewTemplate: tplAdminHookNew,
}, nil
}
@@ -110,7 +110,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
}
func checkHookType(ctx *context.Context) string {
- hookType := strings.ToLower(ctx.Params(":type"))
+ hookType := strings.ToLower(ctx.PathParam(":type"))
if !util.SliceContainsString(setting.Webhook.Types, hookType, true) {
ctx.NotFound("checkHookType", nil)
return ""
@@ -592,11 +592,11 @@ func checkWebhook(ctx *context.Context) (*ownerRepoCtx, *webhook.Webhook) {
var w *webhook.Webhook
if orCtx.RepoID > 0 {
- w, err = webhook.GetWebhookByRepoID(ctx, orCtx.RepoID, ctx.ParamsInt64(":id"))
+ w, err = webhook.GetWebhookByRepoID(ctx, orCtx.RepoID, ctx.PathParamInt64(":id"))
} else if orCtx.OwnerID > 0 {
- w, err = webhook.GetWebhookByOwnerID(ctx, orCtx.OwnerID, ctx.ParamsInt64(":id"))
+ w, err = webhook.GetWebhookByOwnerID(ctx, orCtx.OwnerID, ctx.PathParamInt64(":id"))
} else if orCtx.IsAdmin {
- w, err = webhook.GetSystemOrDefaultWebhook(ctx, ctx.ParamsInt64(":id"))
+ w, err = webhook.GetSystemOrDefaultWebhook(ctx, ctx.PathParamInt64(":id"))
}
if err != nil || w == nil {
if webhook.IsErrWebhookNotExist(err) {
@@ -645,7 +645,7 @@ func WebHooksEdit(ctx *context.Context) {
// TestWebhook test if web hook is work fine
func TestWebhook(ctx *context.Context) {
- hookID := ctx.ParamsInt64(":id")
+ hookID := ctx.PathParamInt64(":id")
w, err := webhook.GetWebhookByRepoID(ctx, ctx.Repo.Repository.ID, hookID)
if err != nil {
ctx.Flash.Error("GetWebhookByRepoID: " + err.Error())
@@ -706,7 +706,7 @@ func TestWebhook(ctx *context.Context) {
// ReplayWebhook replays a webhook
func ReplayWebhook(ctx *context.Context) {
- hookTaskUUID := ctx.Params(":uuid")
+ hookTaskUUID := ctx.PathParam(":uuid")
orCtx, w := checkWebhook(ctx)
if ctx.Written() {