mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 15:25:43 +03:00
Extend the API to include more repository properties (#3249)
Adds description, stars_count, forks_count, watchers_count and open_issues_count.
This commit is contained in:
parent
fdcca9292e
commit
12cb84b97f
1 changed files with 5 additions and 0 deletions
|
@ -45,11 +45,16 @@ func ToRepository(owner *models.User, repo *models.Repository, permission api.Pe
|
||||||
ID: repo.ID,
|
ID: repo.ID,
|
||||||
Owner: ToUser(owner),
|
Owner: ToUser(owner),
|
||||||
FullName: owner.Name + "/" + repo.Name,
|
FullName: owner.Name + "/" + repo.Name,
|
||||||
|
Description: repo.Description,
|
||||||
Private: repo.IsPrivate,
|
Private: repo.IsPrivate,
|
||||||
Fork: repo.IsFork,
|
Fork: repo.IsFork,
|
||||||
HtmlUrl: setting.AppUrl + owner.Name + "/" + repo.Name,
|
HtmlUrl: setting.AppUrl + owner.Name + "/" + repo.Name,
|
||||||
CloneUrl: cl.HTTPS,
|
CloneUrl: cl.HTTPS,
|
||||||
SshUrl: cl.SSH,
|
SshUrl: cl.SSH,
|
||||||
|
OpenIssues: repo.NumOpenIssues,
|
||||||
|
Stars: repo.NumStars,
|
||||||
|
Forks: repo.NumForks,
|
||||||
|
Watchers: repo.NumWatches,
|
||||||
Permissions: permission,
|
Permissions: permission,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue