Skip to content

Commit

Permalink
fix: fix filter when snakecase mapper is used
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSmolko authored and dziraf committed Jun 13, 2023
1 parent 107943f commit 983a6d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/convert-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const convertFilter = (
qb.where(path, operators.eq, value as string);
} else if (property.type() === 'string') {
// Should be safe: https://github.com/knex/documentation/issues/73#issuecomment-572482153
qb.where(raw(`lower(${path})`), operators.like, `%${String(value).toLowerCase()}%`);
qb.where(raw('lower(??)', [path]), operators.like, `%${String(value).toLowerCase()}%`);
} else {
qb.where(path, operators.eq, value as string);
}
Expand Down

0 comments on commit 983a6d2

Please sign in to comment.