Skip to content

Commit f2cabe7

Browse files
fix(ui): account for array values in transformWhereToNaturalLanguage (#14339)
Fixes #14331 Some queries contain arrays, this PR checks for that and renders the values within.
1 parent a2b1c9b commit f2cabe7

File tree

1 file changed

+5
-1
lines changed
  • packages/ui/src/elements/QueryPresets/cells/WhereCell

1 file changed

+5
-1
lines changed

packages/ui/src/elements/QueryPresets/cells/WhereCell/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ const transformWhereToNaturalLanguage = (where: Where): string => {
2222
const operator = Object.keys(andQuery[key])[0]
2323
const value = andQuery[key][operator]
2424

25-
return `${toWords(key)} ${operator} ${toWords(value)}`
25+
if (typeof value === 'string') {
26+
return `${toWords(key)} ${operator} ${toWords(value)}`
27+
} else if (Array.isArray(value)) {
28+
return `${toWords(key)} ${operator} ${value.map((val) => toWords(val)).join(' or ')}`
29+
}
2630
}
2731

2832
return ''

0 commit comments

Comments
 (0)