Skip to content

Commit

Permalink
refactor: update function name and call in secret-related files
Browse files Browse the repository at this point in the history
- Change the function name from `ChangeSecret` to `UpdateSecret` in `models/secret/secret.go`
- Update the function call from `ChangeSecret` to `UpdateSecret` in `routers/api/v1/org/action.go`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Aug 23, 2023
1 parent d57d49d commit 14b25cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions models/secret/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ func CountSecrets(ctx context.Context, opts *FindSecretsOptions) (int64, error)
return db.GetEngine(ctx).Where(opts.toConds()).Count(new(Secret))
}

// ChangeSecret changes org or user reop secret.
func ChangeSecret(ctx context.Context, orgID, repoID int64, name, data string) error {
// UpdateSecret changes org or user reop secret.
func UpdateSecret(ctx context.Context, orgID, repoID int64, name, data string) error {
sc := new(Secret)
has, err := db.GetEngine(ctx).
Where("owner_id=?", orgID).
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/org/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func UpdateOrgSecret(ctx *context.APIContext) {
// "$ref": "#/responses/forbidden"
secretName := ctx.Params(":secretname")
opt := web.GetForm(ctx).(*api.UpdateSecretOption)
err := secret_model.ChangeSecret(
err := secret_model.UpdateSecret(
ctx, ctx.Org.Organization.ID, 0, secretName, opt.Data,
)
if err != nil {
Expand Down

0 comments on commit 14b25cd

Please sign in to comment.