Skip to content

Commit

Permalink
fix: scriptName in filters (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
exu authored Feb 3, 2022
1 parent 3be610c commit 390a32c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/app/api/v1/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ func (s TestKubeAPI) RoutesHandler() fiber.Handler {
func getFilterFromRequest(c *fiber.Ctx) result.Filter {

filter := result.NewExecutionsFilter()

// id for /scripts/ID/executions
scriptName := c.Params("id", "")
if scriptName != "" {
// query param for /executions?scriptName
scriptName = c.Query("scriptName", "")
}
if scriptName != "" {
filter = filter.WithScriptName(scriptName)
}
Expand Down

0 comments on commit 390a32c

Please sign in to comment.