0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 21:32:56 +01:00

add route for webui

This commit is contained in:
6543 2024-10-21 19:00:16 +02:00
parent 5dd06235cc
commit bc81f757b1
2 changed files with 11 additions and 0 deletions

View file

@ -321,6 +321,16 @@ func DeleteProtectedBranchRulePost(ctx *context.Context) {
ctx.JSONRedirect(fmt.Sprintf("%s/settings/branches", ctx.Repo.RepoLink))
}
func UpdateBranchProtectionPriories(ctx *context.Context) {
form := web.GetForm(ctx).([]int64)
repo := ctx.Repo.Repository
if err := git_model.UpdateProtectBranchPriorities(ctx, repo, form); err != nil {
ctx.ServerError("UpdateProtectBranchPriorities", err)
return
}
}
// RenameBranchPost responses for rename a branch
func RenameBranchPost(ctx *context.Context) {
form := web.GetForm(ctx).(*forms.RenameBranchForm)

View file

@ -1075,6 +1075,7 @@ func registerRoutes(m *web.Router) {
m.Combo("/edit").Get(repo_setting.SettingsProtectedBranch).
Post(web.Bind(forms.ProtectBranchForm{}), context.RepoMustNotBeArchived(), repo_setting.SettingsProtectedBranchPost)
m.Post("/{id}/delete", repo_setting.DeleteProtectedBranchRulePost)
m.Post("/priority", web.Bind([]int64{}), context.RepoMustNotBeArchived(), repo_setting.UpdateBranchProtectionPriories)
})
m.Group("/tags", func() {