mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 20:27:30 +02:00
Registrant API: Include unscoped domain list size
This commit is contained in:
parent
84755226a3
commit
d4312caa91
1 changed files with 8 additions and 1 deletions
|
@ -25,7 +25,8 @@ module Api
|
|||
serializer.to_json
|
||||
end
|
||||
|
||||
render json: { count: domains.count, domains: serialized_domains }
|
||||
render json: { total: current_user_domains_total_count, count: domains.count,
|
||||
domains: serialized_domains }
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -41,6 +42,12 @@ module Api
|
|||
|
||||
private
|
||||
|
||||
def current_user_domains_total_count
|
||||
current_registrant_user.domains.count
|
||||
rescue CompanyRegister::NotAvailableError
|
||||
current_registrant_user.direct_domains.count
|
||||
end
|
||||
|
||||
def current_user_domains
|
||||
current_registrant_user.domains(admin: params[:tech] != 'true')
|
||||
rescue CompanyRegister::NotAvailableError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue