mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
Registrant API: Allow tech domain query without tech flag
This commit is contained in:
parent
747aa502d0
commit
63a15154cb
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,8 @@ module Api
|
|||
module V1
|
||||
module Registrant
|
||||
class DomainsController < ::Api::V1::Registrant::BaseController
|
||||
before_action :set_tech_flag, only: [:show]
|
||||
|
||||
def index
|
||||
limit = params[:limit] || 200
|
||||
offset = params[:offset] || 0
|
||||
|
@ -42,6 +44,12 @@ module Api
|
|||
|
||||
private
|
||||
|
||||
def set_tech_flag
|
||||
# current_user_domains scope depends on tech flag
|
||||
# However, if it's not present, tech contact can not see specific domain entry at all.
|
||||
params.merge!(tech: 'true')
|
||||
end
|
||||
|
||||
def current_user_domains_total_count
|
||||
current_registrant_user.domains.count
|
||||
rescue CompanyRegister::NotAvailableError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue