From 63a15154cba437314ff8c99e85bcdb1b840d2731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 26 Feb 2021 17:18:52 +0200 Subject: [PATCH] Registrant API: Allow tech domain query without tech flag --- app/controllers/api/v1/registrant/domains_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/api/v1/registrant/domains_controller.rb b/app/controllers/api/v1/registrant/domains_controller.rb index 12b060e6c..94d2c865a 100644 --- a/app/controllers/api/v1/registrant/domains_controller.rb +++ b/app/controllers/api/v1/registrant/domains_controller.rb @@ -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