From c260f54c736c05986617cd3fb4846737fbd18058 Mon Sep 17 00:00:00 2001 From: artaasadi Date: Fri, 27 Dec 2024 23:04:39 +0100 Subject: [PATCH] fix: add query type --- services/inventory/http_routes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/inventory/http_routes.go b/services/inventory/http_routes.go index 806ad2525..77fae7335 100644 --- a/services/inventory/http_routes.go +++ b/services/inventory/http_routes.go @@ -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()