Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/search/postgres/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func standardizeQueryAndPopulatePath(q *v1.Query, optionsMap searchPkg.OptionsMa

fromClause := stringutils.JoinNonEmpty(", ", froms...)
selQuery := generateSelectFields(queryEntry, schema.LocalPrimaryKeys(), selectType)
pagination, err := getPaginationQuery(q.Pagination, schema, dbFields)
pagination, err := getPaginationQuery(q.GetPagination(), schema, dbFields)
if err != nil {
return nil, err
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/search/postgres/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ func TestMultiTableQueries(t *testing.T) {
Data: []interface{}{"central%"},
},
},
{
desc: "nil query",
q: nil,
expected: &query{
Select: selectQuery{
Query: "select deployments.Id",
},
From: "deployments",
Where: "",
Data: []interface{}{},
},
},
} {
t.Run(c.desc, func(t *testing.T) {
actual, err := standardizeQueryAndPopulatePath(c.q, mappings.OptionsMap, deploymentBaseSchema, GET)
Expand Down