mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 00:45:22 +02:00
Move Repo APIFormat to convert package (#13787)
* Move Repo APIFormat to convert package * tweek
This commit is contained in:
parent
2b4a08e962
commit
7ac8a770e1
18 changed files with 201 additions and 193 deletions
|
@ -21,13 +21,13 @@ import (
|
|||
func appendPrivateInformation(apiKey *api.DeployKey, key *models.DeployKey, repository *models.Repository) (*api.DeployKey, error) {
|
||||
apiKey.ReadOnly = key.Mode == models.AccessModeRead
|
||||
if repository.ID == key.RepoID {
|
||||
apiKey.Repository = repository.APIFormat(key.Mode)
|
||||
apiKey.Repository = convert.ToRepo(repository, key.Mode)
|
||||
} else {
|
||||
repo, err := models.GetRepositoryByID(key.RepoID)
|
||||
if err != nil {
|
||||
return apiKey, err
|
||||
}
|
||||
apiKey.Repository = repo.APIFormat(key.Mode)
|
||||
apiKey.Repository = convert.ToRepo(repo, key.Mode)
|
||||
}
|
||||
return apiKey, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue