Skip to content

Commit

Permalink
fix: fix PostgreSQL enum filter query (#17)(@toadfansboy)
Browse files Browse the repository at this point in the history
  • Loading branch information
toadfansx authored Apr 11, 2024
1 parent d53ab06 commit d63679e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class Resource extends BaseResource {
&& ['date', 'datetime'].includes(filter.property.type())
) {
q.whereBetween(key, [filter.value.from, filter.value.to]);
} else if (filter.property.type() === 'string') {
} else if (filter.property.type() === 'string' && !filter.property.availableValues) {
if (this.dialect === 'postgresql') {
q.whereILike(key, `%${filter.value}%`);
} else {
Expand Down

0 comments on commit d63679e

Please sign in to comment.