1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-16 07:18:37 +00:00

Move RepoTransfer from models to models/repo sub package (#32506)

`RepoTransfer` now is at models, but if we want to move it into `repo`
model, it will depend on `Team`. So this PR also makes repo model depend
on org model to make it possible. Just refactor, no code change.

- [x] Move `DeleteOrganization` from `models/organization` to service
layer
- [x] Move `AccessibleTeamReposEnv` to `models/repo`
- [x] Move `RepoTransfer` from `models` to `models/repo`
- [x] Merge `getUserTeamIDs` and `GetUserTeamIDs`, Merge `GetUserTeams`
and `getUserTeams`.
- [x] Remove `Team`'s `Repos []*repo_model.Repository` to avoid dependency recycle.
This commit is contained in:
Lunny Xiao
2024-12-17 19:44:16 -08:00
committed by GitHub
parent b945742293
commit e4c4629465
30 changed files with 383 additions and 389 deletions

View File

@@ -42,7 +42,7 @@ func ListTeams(ctx *context.APIContext) {
return
}
teams, err := organization.GetRepoTeams(ctx, ctx.Repo.Repository)
teams, err := organization.GetRepoTeams(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID)
if err != nil {
ctx.InternalServerError(err)
return