From f3b5d1c0e13ac28b83ce0109b071a58dc983d551 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 2 May 2024 10:35:55 -0700 Subject: [PATCH] fix: availableValues regression 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. --- src/Resource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resource.ts b/src/Resource.ts index 2c8e326..674b811 100644 --- a/src/Resource.ts +++ b/src/Resource.ts @@ -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 {