Skip to content

Commit

Permalink
fix: add query type
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 27, 2024
1 parent 05f5d33 commit c260f54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/inventory/http_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,9 +1113,12 @@ func (h *HttpHandler) RunQueryByID(ctx echo.Context) error {
if err := bindValidate(ctx, &req); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
}
if req.ID == "" || req.Type == "" {
if req.ID == "" {
return echo.NewHTTPError(http.StatusBadRequest, "Runnable Type and ID should be provided")
}
if req.Type == "" {
req.Type = "namedquery"
}

newCtx, cancel := context.WithTimeout(ctx.Request().Context(), 30*time.Second)
defer cancel()
Expand Down

0 comments on commit c260f54

Please sign in to comment.