From 52b612f6200f85472c83b46ec2eb916db57657f7 Mon Sep 17 00:00:00 2001 From: Melisa Anabella Rossi Date: Fri, 3 May 2024 16:22:18 -0300 Subject: [PATCH] fix: collection search lowercase (#747) --- src/Collection/Collection.model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Collection/Collection.model.ts b/src/Collection/Collection.model.ts index 9cc7027e..f808822c 100644 --- a/src/Collection/Collection.model.ts +++ b/src/Collection/Collection.model.ts @@ -105,12 +105,13 @@ export class Collection extends Model { ) { return SQL`` } + const search = `%${q}%` const isStandard = SQL`collections.third_party_id is NULL AND collections.urn_suffix is NULL` const isThirdParty = SQL`collections.third_party_id is NOT NULL AND collections.urn_suffix is NOT NULL` const isInRemoteIds = SQL`collections.contract_address = ANY(${remoteIds})` const sameStatusAndInTheBlockchain = SQL`(collection_curations.status = ${status} AND (${isInRemoteIds} OR (${isThirdParty})))` const conditions = [ - q ? SQL`collections.name % ${q} ` : undefined, + q ? SQL`collections.name ILIKE ${search} ` : undefined, assignee ? SQL`collection_curations.assignee = ${assignee}` : undefined, address ? thirdPartyIds?.length