Fix prefixes for SQS
This commit is contained in:
parent
1cd3347262
commit
c845db966f
|
@ -135,20 +135,36 @@ function cleanupFilters(
|
||||||
allTables.some(table => table.schema[key])
|
allTables.some(table => table.schema[key])
|
||||||
|
|
||||||
const splitter = new dataFilters.ColumnSplitter(allTables)
|
const splitter = new dataFilters.ColumnSplitter(allTables)
|
||||||
for (const filter of Object.values(filters)) {
|
|
||||||
for (const key of Object.keys(filter)) {
|
const prefixFilters = (filters: SearchFilters) => {
|
||||||
const { numberPrefix, relationshipPrefix, column } = splitter.run(key)
|
for (const filterKey of Object.keys(filters) as (keyof SearchFilters)[]) {
|
||||||
if (keyInAnyTable(column)) {
|
if (
|
||||||
filter[
|
filterKey === LogicalOperator.AND ||
|
||||||
`${numberPrefix || ""}${relationshipPrefix || ""}${mapToUserColumn(
|
filterKey === LogicalOperator.OR
|
||||||
column
|
) {
|
||||||
)}`
|
for (const condition of filters[filterKey]!.conditions) {
|
||||||
] = filter[key]
|
prefixFilters(condition)
|
||||||
delete filter[key]
|
}
|
||||||
|
} else {
|
||||||
|
const filter = filters[filterKey]!
|
||||||
|
if (typeof filter !== "object") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for (const key of Object.keys(filter)) {
|
||||||
|
const { numberPrefix, relationshipPrefix, column } = splitter.run(key)
|
||||||
|
if (keyInAnyTable(column)) {
|
||||||
|
filter[
|
||||||
|
`${numberPrefix || ""}${
|
||||||
|
relationshipPrefix || ""
|
||||||
|
}${mapToUserColumn(column)}`
|
||||||
|
] = filter[key]
|
||||||
|
delete filter[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
prefixFilters(filters)
|
||||||
return filters
|
return filters
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue