Skip to content

Commit 698d26a

Browse files
fix: use model name when case insensitive filtering
1 parent f71f9dc commit 698d26a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/convert-filter.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const convertFilter = (filter) => {
1919
}
2020
return {
2121
[Op.and]: [
22-
where(fn('LOWER', col(property.name())), { [Op.like]: fn('LOWER', `%${escape(value)}%`) }),
22+
where(
23+
fn('LOWER', col(`${property.sequelizePath.Model.name}.${property.name()}`)),
24+
Op.like,
25+
fn('LOWER', `%${escape(value)}%`),
26+
),
2327
],
2428
...memo,
2529
}

0 commit comments

Comments
 (0)