Skip to content

Commit

Permalink
fix: collection search lowercase (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi authored May 3, 2024
1 parent 2c41ccf commit 52b612f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Collection/Collection.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ export class Collection extends Model<CollectionAttributes> {
) {
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
Expand Down

0 comments on commit 52b612f

Please sign in to comment.