Skip to content

Commit

Permalink
fix custom board handler
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
Frank Jogeleit committed Jan 18, 2024
1 parent 2b9944f commit e707a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions backend/pkg/server/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func (h *Handler) GetResourceDetails(ctx *gin.Context) {
}

func (h *Handler) GetCustomBoard(ctx *gin.Context) {
var err error

config, ok := h.boards[ctx.Param("id")]
if !ok {
ctx.AbortWithStatus(http.StatusNotFound)
Expand All @@ -84,14 +86,12 @@ func (h *Handler) GetCustomBoard(ctx *gin.Context) {
query["sources"] = sources
}

g := &errgroup.Group{}
if len(sources) == 0 {
g.Go(func() error {
var err error
sources, err = endpoints.Core.ListSources(ctx, url.Values{})

return err
})
sources, err = endpoints.Core.ListSources(ctx, url.Values{})
if err != nil {
ctx.AbortWithError(http.StatusInternalServerError, err)
return
}
}

var namespaces []string
Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (s *Service) Dashboard(ctx context.Context, cluster string, sources []strin
var findingChart any
if len(sources) > 1 {
findingChart = MapFindingSourcesToFindingCharts(findings)
} else {
} else if len(sources) == 1 {
findingChart = MapFindingsToSourceStatusChart(sources[0], findings)
}

Expand Down

0 comments on commit e707a62

Please sign in to comment.