mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
Return truemail
This reverts commit 862f5639ebbe4d3e6abd5d5be7fb7840e7b83bdf.
This commit is contained in:
parent
0a7b754c4c
commit
e4a02c2e47
35 changed files with 728 additions and 153 deletions
|
@ -13,10 +13,10 @@ module Admin
|
|||
search_params[:registrant_domains_id_not_null] = 1
|
||||
end
|
||||
|
||||
contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name')
|
||||
contacts = Contact.includes(:registrar).joins(:registrar)
|
||||
.select('contacts.*, registrars.name')
|
||||
contacts = contacts.filter_by_states(params[:statuses_contains].join(',')) if params[:statuses_contains]
|
||||
contacts = contacts.where("ident_country_code is null or ident_country_code=''") if params[:only_no_country_code].eql?('1')
|
||||
|
||||
contacts = filter_by_flags(contacts)
|
||||
|
||||
normalize_search_parameters do
|
||||
@q = contacts.search(search_params)
|
||||
|
@ -26,6 +26,14 @@ module Admin
|
|||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def filter_by_flags(contacts)
|
||||
if params[:only_no_country_code].eql?('1')
|
||||
contacts = contacts.where("ident_country_code is null or ident_country_code=''")
|
||||
end
|
||||
contacts = contacts.email_verification_failed if params[:email_verification_failed].eql?('1')
|
||||
contacts
|
||||
end
|
||||
|
||||
def search
|
||||
render json: Contact.search_by_query(params[:q])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue