mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Enhance routers for the Actions variable operations (#33547)
- Find the variable before updating or deleting - Move the main logic from `routers/web/repo/setting/variables.go` to `routers/web/shared/actions/variables.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -37,6 +37,7 @@ import (
|
||||
"code.gitea.io/gitea/routers/web/repo"
|
||||
"code.gitea.io/gitea/routers/web/repo/actions"
|
||||
repo_setting "code.gitea.io/gitea/routers/web/repo/setting"
|
||||
shared_actions "code.gitea.io/gitea/routers/web/shared/actions"
|
||||
"code.gitea.io/gitea/routers/web/shared/project"
|
||||
"code.gitea.io/gitea/routers/web/user"
|
||||
user_setting "code.gitea.io/gitea/routers/web/user/setting"
|
||||
@@ -449,10 +450,10 @@ func registerRoutes(m *web.Router) {
|
||||
|
||||
addSettingsVariablesRoutes := func() {
|
||||
m.Group("/variables", func() {
|
||||
m.Get("", repo_setting.Variables)
|
||||
m.Post("/new", web.Bind(forms.EditVariableForm{}), repo_setting.VariableCreate)
|
||||
m.Post("/{variable_id}/edit", web.Bind(forms.EditVariableForm{}), repo_setting.VariableUpdate)
|
||||
m.Post("/{variable_id}/delete", repo_setting.VariableDelete)
|
||||
m.Get("", shared_actions.Variables)
|
||||
m.Post("/new", web.Bind(forms.EditVariableForm{}), shared_actions.VariableCreate)
|
||||
m.Post("/{variable_id}/edit", web.Bind(forms.EditVariableForm{}), shared_actions.VariableUpdate)
|
||||
m.Post("/{variable_id}/delete", shared_actions.VariableDelete)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user