Added white ip show page

This commit is contained in:
Sergei Tsoganov 2023-05-30 15:49:56 +03:00
parent 18cd6f5046
commit b44c757602
2 changed files with 8 additions and 2 deletions

View file

@ -11,10 +11,16 @@ module Repp
def index
ips = current_user.registrar.white_ips
render_success(data: { ips: ips.as_json(except: %i[creator_str updator_str]),
render_success(data: { ips: ips.as_json,
count: ips.count })
end
api :GET, '/repp/v1/white_ips/:id'
desc 'Get a specific whitelisted IP address'
def show
render_success(data: { ip: @white_ip.as_json, interfaces: WhiteIp::INTERFACES })
end
api :POST, '/repp/v1/white_ips'
desc 'Add new whitelisted IP'
def create

View file

@ -109,7 +109,7 @@ Rails.application.routes.draw do
end
end
resources :api_users, only: %i[index show update create destroy]
resources :white_ips, only: %i[index update create destroy]
resources :white_ips, only: %i[index show update create destroy]
namespace :registrar do
resources :notifications, only: %i[index show update] do
collection do