Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
fix: allows searching own/placed domains by name (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar authored May 13, 2020
1 parent 8f95119 commit e122a4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rns/hooks/domain.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
},
async (context: HookContext) => {
if (context.params.query?.status) {
const { status, ownerAddress } = context.params.query
const { status, ownerAddress, name: nameFilter } = context.params.query

const isOwned = status === 'owned'
const sql =
Expand Down Expand Up @@ -78,6 +78,7 @@ export default {
)
${isOwned ? `AND "active_offers"."tokenId" IS NULL
AND ("INACTIVE_OFFERS"."tokenId" IS NOT NULL OR "offers"."tokenId" IS NULL)` : ''}
${nameFilter?.$like ? `AND "Domain"."name" LIKE '%${nameFilter.$like}%'` : ''}
`

const sequelize = context.app.get('sequelize')
Expand Down

0 comments on commit e122a4a

Please sign in to comment.