Skip to content

Commit

Permalink
filter bounty selector to V2 pubkeys only
Browse files Browse the repository at this point in the history
  • Loading branch information
saithsab877 committed Nov 14, 2024
1 parent 94a8b97 commit d63e02f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,13 @@ func (db database) GetPeopleBySearch(r *http.Request) []Person {

// if search is empty, returns all

// return if like owner_alias, unique_name, or equals pubkey
db.db.Offset(offset).Limit(limit).Order(sortBy+" "+direction+" NULLS LAST").Where("(unlisted = 'f' OR unlisted is null) AND (deleted = 'f' OR deleted is null)").Where("LOWER(owner_alias) LIKE ?", "%"+search+"%").Or("LOWER(unique_name) LIKE ?", "%"+search+"%").Or("LOWER(owner_pub_key) = ?", search).Find(&ms)
// return if like owner_alias, unique_name, or equals pubkey AND owner_pub_key contains "_" (V2 pubkey)
db.db.Offset(offset).Limit(limit).Order(sortBy+" "+direction+" NULLS LAST").
Where("(unlisted = 'f' OR unlisted is null) AND (deleted = 'f' OR deleted is null)").
Where("owner_pub_key LIKE ?", "%_%").
Where("(LOWER(owner_alias) LIKE ? OR LOWER(unique_name) LIKE ? OR LOWER(owner_pub_key) = ?)",
"%"+search+"%", "%"+search+"%", search).
Find(&ms)
return ms
}

Expand Down

0 comments on commit d63e02f

Please sign in to comment.