Skip to content

Commit 5dd0623

Browse files
committed
future profe API
as its an object we can add stuff later on
1 parent e944bef commit 5dd0623

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

modules/structs/repo_branch.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,6 @@ type EditBranchProtectionOption struct {
127127
}
128128

129129
// UpdateBranchProtectionPriories a list to update the branch protection rule priorities
130-
type UpdateBranchProtectionPriories []int64
130+
type UpdateBranchProtectionPriories []struct {
131+
ID int64 `json:"id"`
132+
}

routers/api/v1/repo/branch.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,12 @@ func UpdateBranchProtectionPriories(ctx *context.APIContext) {
11221122
form := web.GetForm(ctx).(*api.UpdateBranchProtectionPriories)
11231123
repo := ctx.Repo.Repository
11241124

1125-
if err := git_model.UpdateProtectBranchPriorities(ctx, repo, *form); err != nil {
1125+
ids := make([]int64, len(*form))
1126+
for i, v := range *form {
1127+
ids[i] = v.ID
1128+
}
1129+
1130+
if err := git_model.UpdateProtectBranchPriorities(ctx, repo, ids); err != nil {
11261131
ctx.Error(http.StatusInternalServerError, "UpdateProtectBranchPriorities", err)
11271132
return
11281133
}

templates/swagger/v1_json.tmpl

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)