mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
Refactor
This commit is contained in:
parent
14187b76f1
commit
4af3e80087
3 changed files with 20 additions and 11 deletions
|
@ -2,7 +2,6 @@ module Repp
|
|||
class API < Grape::API
|
||||
format :json
|
||||
prefix :repp
|
||||
version 'v1', using: :path
|
||||
|
||||
http_basic do |username, password|
|
||||
@current_user ||= EppUser.find_by(username: username, password: password)
|
||||
|
@ -12,15 +11,6 @@ module Repp
|
|||
attr_reader :current_user
|
||||
end
|
||||
|
||||
resource :domains do
|
||||
desc 'Return list of domains'
|
||||
get '/' do
|
||||
domains = current_user.registrar.domains.page(params[:page])
|
||||
{
|
||||
domains: domains,
|
||||
total_pages: domains.total_pages
|
||||
}
|
||||
end
|
||||
end
|
||||
mount Repp::DomainV1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue