1
0
Fork 0
forked from forgejo/forgejo

Move createrepository from module to service layer (#26927)

Repository creation depends on many models, so moving it to service
layer is better.
This commit is contained in:
Lunny Xiao 2023-09-06 20:08:51 +08:00 committed by GitHub
parent b3d88ada01
commit b9df9fa2e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 510 additions and 482 deletions

View file

@ -27,7 +27,7 @@ import (
)
// AdoptRepository adopts pre-existing repository files for the user/organization.
func AdoptRepository(ctx context.Context, doer, u *user_model.User, opts repo_module.CreateRepoOptions) (*repo_model.Repository, error) {
func AdoptRepository(ctx context.Context, doer, u *user_model.User, opts CreateRepoOptions) (*repo_model.Repository, error) {
if !doer.IsAdmin && !u.CanCreateRepo() {
return nil, repo_model.ErrReachLimitOfRepo{
Limit: u.MaxRepoCreation,