Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/dashboard/storybo…
Browse files Browse the repository at this point in the history
…ok-8.1.10
  • Loading branch information
Azanul authored Jun 23, 2024
2 parents d59d4a9 + a9183aa commit 17c211e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
version: "~> v1"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 6 additions & 2 deletions handlers/dashboard_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@ func (handler *ApiHandler) CostBreakdownHandler(c *gin.Context) {
}
excludeList := strings.Trim(string(s), "[]")
excludeList = strings.ReplaceAll(excludeList, `"`, "'")
excludeItems := strings.Split(excludeList, ",")
for i := range excludeItems {
excludeItems[i] = strings.TrimSpace(excludeItems[i])
}

query := fmt.Sprintf(`%s ? NOT IN (%s) AND DATE(fetched_at) BETWEEN ? AND ? GROUP BY ?`, query, excludeList)
err = handler.db.NewRaw(query, bun.Ident(input.Group), input.Start, input.End, bun.Ident(input.Group)).Scan(handler.ctx, &groups)
query = query + ` ? NOT IN ? AND DATE(fetched_at) BETWEEN ? AND ? GROUP BY ?`
err = handler.db.NewRaw(query, bun.Ident(input.Group), bun.In(excludeItems), input.Start, input.End, bun.Ident(input.Group)).Scan(handler.ctx, &groups)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down

0 comments on commit 17c211e

Please sign in to comment.