Skip to content

Commit

Permalink
fix(api): listing empty deployments for repo (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockopp authored Oct 15, 2021
1 parent 64f8df2 commit a2768e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func GetDeployments(c *gin.Context) {
return
}

var dWithBs []*library.Deployment
dWithBs := []*library.Deployment{}
for _, deployment := range d {
b, err := database.FromContext(c).GetDeploymentBuildList(*deployment.URL)
if err != nil {
Expand All @@ -221,11 +221,14 @@ func GetDeployments(c *gin.Context) {

return
}
var builds []library.Build

builds := []library.Build{}
for _, build := range b {
builds = append(builds, *build)
}

deployment.SetBuilds(builds)

dWithBs = append(dWithBs, deployment)
}

Expand Down

0 comments on commit a2768e0

Please sign in to comment.