Skip to content

Commit 8438a0c

Browse files
committed
refactor: refactor function names in API and org package
- Change the `CreateOrUpdateOrgSecret` function name to `CreateOrUpdateSecret` in `routers/api/v1/api.go` - Change the `CreateOrUpdateOrgSecret` function name to `CreateOrUpdateSecret` in `routers/api/v1/org/action.go` Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 62bede0 commit 8438a0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routers/api/v1/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ func Routes() *web.Route {
13051305
m.Group("/actions/secrets", func() {
13061306
m.Get("", reqToken(), reqOrgOwnership(), org.ListActionsSecrets)
13071307
m.Combo("/{secretname}").
1308-
Put(reqToken(), reqOrgOwnership(), bind(api.CreateOrUpdateSecretOption{}), org.CreateOrUpdateOrgSecret).
1308+
Put(reqToken(), reqOrgOwnership(), bind(api.CreateOrUpdateSecretOption{}), org.CreateOrUpdateSecret).
13091309
Delete(reqToken(), reqOrgOwnership(), org.DeleteOrgSecret)
13101310
})
13111311
m.Group("/public_members", func() {

routers/api/v1/org/action.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func listActionsSecrets(ctx *context.APIContext) {
7474
}
7575

7676
// create or update one secret of the organization
77-
func CreateOrUpdateOrgSecret(ctx *context.APIContext) {
77+
func CreateOrUpdateSecret(ctx *context.APIContext) {
7878
// swagger:operation PUT /orgs/{org}/actions/secrets/{secretname} organization updateOrgSecret
7979
// ---
8080
// summary: Create or Update a secret value in an organization
@@ -108,7 +108,7 @@ func CreateOrUpdateOrgSecret(ctx *context.APIContext) {
108108
// "$ref": "#/responses/forbidden"
109109
secretName := ctx.Params(":secretname")
110110
if err := actions.NameRegexMatch(secretName); err != nil {
111-
ctx.Error(http.StatusBadRequest, "CreateOrUpdateOrgSecret", err)
111+
ctx.Error(http.StatusBadRequest, "CreateOrUpdateSecret", err)
112112
return
113113
}
114114
opt := web.GetForm(ctx).(*api.CreateOrUpdateSecretOption)

0 commit comments

Comments
 (0)