code.gitea.io/gitea@v1.21.7/models/organization/org_repo.go (about)

     1  // Copyright 2022 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package organization
     5  
     6  import (
     7  	"context"
     8  
     9  	"code.gitea.io/gitea/models/db"
    10  	repo_model "code.gitea.io/gitea/models/repo"
    11  )
    12  
    13  // GetOrgRepositories get repos belonging to the given organization
    14  func GetOrgRepositories(ctx context.Context, orgID int64) (repo_model.RepositoryList, error) {
    15  	var orgRepos []*repo_model.Repository
    16  	return orgRepos, db.GetEngine(ctx).Where("owner_id = ?", orgID).Find(&orgRepos)
    17  }