Skip to content

Commit

Permalink
feat: ✨ adding "%" in a filter will now use iLike instead of like
Browse files Browse the repository at this point in the history
  • Loading branch information
nicgirault committed May 15, 2020
1 parent c2af94b commit 9fb5cff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/getList/filteredList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('defaultParseFilter', () => {
{ email: '%lalilo.com' },
{
email: {
[Op.like]: '%lalilo.com',
[Op.iLike]: '%lalilo.com',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/getList/filteredList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type ParseFilter = (filter: Record<string, any>) => WhereAttributeHash
export const defaultParseFilter: ParseFilter = filter =>
mapValues(filter, value => {
if (typeof value === 'string' && value.indexOf('%') !== -1) {
return { [Op.like]: value }
return { [Op.iLike]: value }
}
return value
})
Expand Down

0 comments on commit 9fb5cff

Please sign in to comment.