diff options
Diffstat (limited to 'routers/api/v1/repo/action.go')
-rw-r--r-- | routers/api/v1/repo/action.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/api/v1/repo/action.go b/routers/api/v1/repo/action.go index f6656d89c6..48ba35ac21 100644 --- a/routers/api/v1/repo/action.go +++ b/routers/api/v1/repo/action.go @@ -122,7 +122,7 @@ func (Action) CreateOrUpdateSecret(ctx *context.APIContext) { opt := web.GetForm(ctx).(*api.CreateOrUpdateSecretOption) - _, created, err := secret_service.CreateOrUpdateSecret(ctx, owner.ID, repo.ID, ctx.Params("secretname"), opt.Data) + _, created, err := secret_service.CreateOrUpdateSecret(ctx, owner.ID, repo.ID, ctx.PathParam("secretname"), opt.Data) if err != nil { if errors.Is(err, util.ErrInvalidArgument) { ctx.Error(http.StatusBadRequest, "CreateOrUpdateSecret", err) @@ -177,7 +177,7 @@ func (Action) DeleteSecret(ctx *context.APIContext) { owner := ctx.Repo.Owner repo := ctx.Repo.Repository - err := secret_service.DeleteSecretByName(ctx, owner.ID, repo.ID, ctx.Params("secretname")) + err := secret_service.DeleteSecretByName(ctx, owner.ID, repo.ID, ctx.PathParam("secretname")) if err != nil { if errors.Is(err, util.ErrInvalidArgument) { ctx.Error(http.StatusBadRequest, "DeleteSecret", err) @@ -224,7 +224,7 @@ func (Action) GetVariable(ctx *context.APIContext) { // "$ref": "#/responses/notFound" v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ RepoID: ctx.Repo.Repository.ID, - Name: ctx.Params("variablename"), + Name: ctx.PathParam("variablename"), }) if err != nil { if errors.Is(err, util.ErrNotExist) { @@ -280,7 +280,7 @@ func (Action) DeleteVariable(ctx *context.APIContext) { // "404": // "$ref": "#/responses/notFound" - if err := actions_service.DeleteVariableByName(ctx, 0, ctx.Repo.Repository.ID, ctx.Params("variablename")); err != nil { + if err := actions_service.DeleteVariableByName(ctx, 0, ctx.Repo.Repository.ID, ctx.PathParam("variablename")); err != nil { if errors.Is(err, util.ErrInvalidArgument) { ctx.Error(http.StatusBadRequest, "DeleteVariableByName", err) } else if errors.Is(err, util.ErrNotExist) { @@ -334,7 +334,7 @@ func (Action) CreateVariable(ctx *context.APIContext) { opt := web.GetForm(ctx).(*api.CreateVariableOption) repoID := ctx.Repo.Repository.ID - variableName := ctx.Params("variablename") + variableName := ctx.PathParam("variablename") v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ RepoID: repoID, @@ -402,7 +402,7 @@ func (Action) UpdateVariable(ctx *context.APIContext) { v, err := actions_service.GetVariable(ctx, actions_model.FindVariablesOpts{ RepoID: ctx.Repo.Repository.ID, - Name: ctx.Params("variablename"), + Name: ctx.PathParam("variablename"), }) if err != nil { if errors.Is(err, util.ErrNotExist) { @@ -414,7 +414,7 @@ func (Action) UpdateVariable(ctx *context.APIContext) { } if opt.Name == "" { - opt.Name = ctx.Params("variablename") + opt.Name = ctx.PathParam("variablename") } if _, err := actions_service.UpdateVariable(ctx, v.ID, opt.Name, opt.Value); err != nil { if errors.Is(err, util.ErrInvalidArgument) { |