Simple implementation of retained domains API endpoint

This needed a new name, there are several classes of database object
to be included in that endpoint.

Currently, there is one list ordered by name, with each object
containing status and ascii name for convenience. Can be converted to
multiple fields (reserved and blocked separately). Also contains total
count.

Includes CORS preflight which seems to be a known problem for Rails in
the past.
This commit is contained in:
Maciej Szlosarczyk 2020-05-14 14:33:38 +03:00
parent a2bd9a7cc0
commit 18ce853420
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
4 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,11 @@
module Repp
module V1
class RetainedDomainsController < ActionController::API
def index
domains = RetainedDomains.new
render json: { count: domains.count, domains: domains.to_jsonable }
end
end
end
end