Fix some API bugs (#16184)
* Repository object only count releases as releases (fix #16144) * EditOrg respect RepoAdminChangeTeamAccess option (fix #16013)
This commit is contained in:
parent
29695cd6d5
commit
75205b5669
5 changed files with 13 additions and 5 deletions
|
@ -91,7 +91,7 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool)
|
|||
return nil
|
||||
}
|
||||
|
||||
numReleases, _ := models.GetReleaseCountByRepoID(repo.ID, models.FindReleasesOptions{IncludeDrafts: false, IncludeTags: true})
|
||||
numReleases, _ := models.GetReleaseCountByRepoID(repo.ID, models.FindReleasesOptions{IncludeDrafts: false, IncludeTags: false})
|
||||
|
||||
mirrorInterval := ""
|
||||
if repo.IsMirror {
|
||||
|
|
|
@ -31,6 +31,8 @@ type CreateOrgOption struct {
|
|||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
||||
}
|
||||
|
||||
// TODO: make EditOrgOption fields optional after https://gitea.com/go-chi/binding/pulls/5 got merged
|
||||
|
||||
// EditOrgOption options for editing an organization
|
||||
type EditOrgOption struct {
|
||||
FullName string `json:"full_name"`
|
||||
|
@ -40,5 +42,5 @@ type EditOrgOption struct {
|
|||
// possible values are `public`, `limited` or `private`
|
||||
// enum: public,limited,private
|
||||
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
||||
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
|
||||
RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue