Skip to content

Commit 91c79ce

Browse files
Arta AsadiArta Asadi
authored andcommitted
fix: send parameter values in RunQuery
1 parent b07d561 commit 91c79ce

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

services/core/api/query.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type RunQueryRequest struct {
2020
AccountId *string `json:"account_id"`
2121
SourceId *string `json:"source_id"`
2222
ResultType *string `json:"result_type"`
23+
Params map[string]string `json:"params"`
2324
Engine *QueryEngine `json:"engine"`
2425
Sorts []NamedQuerySortItem `json:"sorts"`
2526
}

services/core/inventory-http_routes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ func (h *HttpHandler) RunQuery(ctx echo.Context) error {
421421
}
422422
h.queryParamsMu.RUnlock()
423423

424+
for k, v := range req.Params {
425+
queryParamMap[k] = v
426+
}
427+
424428
queryTemplate, err := template.New("query").Parse(*req.Query)
425429
if err != nil {
426430
return err

0 commit comments

Comments
 (0)