1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Fix paginationValues being attached to every object inside a query due to recursion

This commit is contained in:
Andrew Kingston 2022-01-05 14:26:13 +00:00
parent 8aa4d49f31
commit 69a1b503c2

View file

@ -32,6 +32,12 @@ class QueryRunner {
// pre-query, make sure datasource variables are added to parameters // pre-query, make sure datasource variables are added to parameters
const parameters = await this.addDatasourceVariables() const parameters = await this.addDatasourceVariables()
let query = this.enrichQueryFields(fields, parameters) let query = this.enrichQueryFields(fields, parameters)
// Add pagination values for REST queries
if (this.pagination) {
query.paginationValues = this.pagination
}
const Integration = integrations[datasource.source] const Integration = integrations[datasource.source]
if (!Integration) { if (!Integration) {
throw "Integration type does not exist." throw "Integration type does not exist."
@ -186,7 +192,6 @@ class QueryRunner {
enrichedQuery[key] = fields[key] enrichedQuery[key] = fields[key]
} }
} }
if ( if (
enrichedQuery.json || enrichedQuery.json ||
enrichedQuery.customData || enrichedQuery.customData ||
@ -203,12 +208,6 @@ class QueryRunner {
} }
delete enrichedQuery.customData delete enrichedQuery.customData
} }
// Just for REST queries
if (this.pagination) {
enrichedQuery.paginationValues = this.pagination
}
return enrichedQuery return enrichedQuery
} }
} }