1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Correctly handling overlapping column names.

This commit is contained in:
mike12345567 2024-06-27 17:55:09 +01:00
parent 1b9211ee6c
commit b0e6d3e72c

View file

@ -99,10 +99,15 @@ function cleanupFilters(
key => (userColumnMap[key] = mapToUserColumn(key))
)
)
// sort longest first, don't find substrings
const userColumnList = Object.keys(userColumnMap).sort(
(a, b) => b.length - a.length
)
// update the keys of filters to manage user columns
for (let filter of Object.values(filters)) {
for (let key of Object.keys(filter)) {
const found = Object.keys(userColumnMap).find(possibleColumn =>
const found = userColumnList.find(possibleColumn =>
key.endsWith(possibleColumn)
)
if (found) {