Skip to content

Commit f5f1180

Browse files
authored
Merge pull request #56 from t1nky/master
fix: filter convertion for string property
2 parents 9896101 + 3791bff commit f5f1180

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils/convert-filter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import escape from 'escape-regexp'
22
import {
3-
Op, where, fn, col,
3+
Op,
44
} from 'sequelize'
55

66
const convertFilter = (filter) => {
@@ -20,11 +20,11 @@ const convertFilter = (filter) => {
2020
return {
2121
[Op.and]: [
2222
...(memo[Op.and] || []),
23-
where(
24-
fn('LOWER', col(`${property.sequelizePath.Model.name}.${property.name()}`)), {
25-
[Op.like as unknown as string]: fn('LOWER', `%${escape(value)}%`),
23+
{
24+
[`${property.name()}`]: {
25+
[Op.iLike as unknown as string]: `%${escape(value)}%`,
2626
},
27-
),
27+
},
2828
],
2929
...memo,
3030
}

0 commit comments

Comments
 (0)