added api endpoint for registrar login

This commit is contained in:
Oleg Hasjanov 2021-07-28 12:11:38 +03:00 committed by olegphenomenon
parent 39b9c94251
commit 6e82d8be9e
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,22 @@
module Repp
module V1
module Registrar
class LoginController < BaseController
api :GET, 'repp/v1/registrar/login'
desc 'check login user and return data'
def index
@login = current_user
# rubocop:disable Style/AndOr
render_success(data: nil) and return unless @login
# rubocop:enable Style/AndOr
data = @login.as_json()
render_success(data: data)
end
end
end
end
end

View file

@ -72,6 +72,11 @@ Rails.application.routes.draw do
get '/all_notifications', to: 'notifications#all_notifications'
end
end
resource :login, only: [:index] do
collection do
get '/', to: 'login#index'
end
end
resources :nameservers do
collection do
put '/', to: 'nameservers#update'