resolve structure conflict

This commit is contained in:
olegphenomenon 2021-10-28 09:49:15 +03:00
parent f6e46b8fe6
commit d56c61bf84
7 changed files with 106 additions and 10 deletions

View file

@ -2,17 +2,23 @@ module Repp
module V1
module Registrar
class AccreditationInfoController < BaseController
api :GET, 'repp/v1/registrar/accreditation_info'
api :GET, 'repp/v1/registrar/accreditation/get_info'
desc 'check login user and return data'
def index
@login = current_user
registrar = current_user.registrar
# name = registrar.name
# reg_no = registrar.reg_no
# rubocop:disable Style/AndOr
render_success(data: nil) and return unless @login
# rubocop:enable Style/AndOr
data = @login.as_json
data = @login.as_json(only: %i[id username name reg_no uuid roles accreditation_date accreditation_expire_date])
data[:registrar_name] = registrar.name
data[:registrar_reg_no] = registrar.reg_no
render_success(data: data)
end