Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Apr 5, 2020
1 parent ca33a95 commit 434ec4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)

repo.mustOwner(e)

numReleases, _ := GetReleaseCountByRepoID(repo.ID, FindReleasesOptions{IncludeDrafts: false, IncludeTags: true})

return &api.Repository{
ID: repo.ID,
Owner: repo.Owner.APIFormat(),
Expand All @@ -376,7 +378,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
Watchers: repo.NumWatches,
OpenIssues: repo.NumOpenIssues,
OpenPulls: repo.NumOpenPulls,
Releases: repo.NumReleases,
Releases: int(numReleases),
DefaultBranch: repo.DefaultBranch,
Created: repo.CreatedUnix.AsTime(),
Updated: repo.UpdatedUnix.AsTime(),
Expand Down

0 comments on commit 434ec4f

Please sign in to comment.