summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/convert
diff options
context:
space:
mode:
authorlstahlman <luke.stahlman@gmail.com>2016-07-10 16:56:15 -0700
committer无闻 <u@gogs.io>2016-07-11 07:56:15 +0800
commit12cb84b97fc10184a9c41c6a3b2b839e018db0b3 (patch)
tree9bba50220c6ba76a3536ffa233ae3ea1d0b7ff2c /routers/api/v1/convert
parentfdcca9292e57dafdf66345a1b9b9c97b7a0b4872 (diff)
downloadgitea-12cb84b97fc10184a9c41c6a3b2b839e018db0b3.tar.gz
gitea-12cb84b97fc10184a9c41c6a3b2b839e018db0b3.zip
Extend the API to include more repository properties (#3249)
Adds description, stars_count, forks_count, watchers_count and open_issues_count.
Diffstat (limited to 'routers/api/v1/convert')
-rw-r--r--routers/api/v1/convert/convert.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/convert/convert.go b/routers/api/v1/convert/convert.go
index 8eca5f4ec6..0bd22f5762 100644
--- a/routers/api/v1/convert/convert.go
+++ b/routers/api/v1/convert/convert.go
@@ -45,11 +45,16 @@ func ToRepository(owner *models.User, repo *models.Repository, permission api.Pe
ID: repo.ID,
Owner: ToUser(owner),
FullName: owner.Name + "/" + repo.Name,
+ Description: repo.Description,
Private: repo.IsPrivate,
Fork: repo.IsFork,
HtmlUrl: setting.AppUrl + owner.Name + "/" + repo.Name,
CloneUrl: cl.HTTPS,
SshUrl: cl.SSH,
+ OpenIssues: repo.NumOpenIssues,
+ Stars: repo.NumStars,
+ Forks: repo.NumForks,
+ Watchers: repo.NumWatches,
Permissions: permission,
}
}