Skip to content

Commit

Permalink
fix: availableValues regression
Browse files Browse the repository at this point in the history
availableValues is a function so it's always not null. Therefore, unless it is called, this block never gets called and the filter always uses = and never like.
  • Loading branch information
nickgieschen authored and dziraf committed Jun 16, 2024
1 parent 4b8cacd commit f3b5d1c
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' && !filter.property.availableValues) {
} 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 f3b5d1c

Please sign in to comment.