-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #683 from internetee/registry-660
Registry 660
- Loading branch information
Showing
161 changed files
with
2,078 additions
and
1,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module Repp | ||
class DomainTransfersV1 < Grape::API | ||
version 'v1', using: :path | ||
|
||
resource :domain_transfers do | ||
post '/' do | ||
params do | ||
requires :data, type: Hash do | ||
requires :domainTransfers, type: Array do | ||
requires :domainName, type: String, allow_blank: false | ||
requires :transferCode, type: String, allow_blank: false | ||
end | ||
end | ||
end | ||
|
||
new_registrar = current_user.registrar | ||
domain_transfers = params['data']['domainTransfers'] | ||
errors = [] | ||
|
||
domain_transfers.each do |domain_transfer| | ||
domain_name = domain_transfer['domainName'] | ||
transfer_code = domain_transfer['transferCode'] | ||
domain = Domain.find_by(name: domain_name) | ||
|
||
if domain | ||
if domain.transfer_code == transfer_code | ||
domain.transfer(new_registrar) | ||
else | ||
errors << { title: "#{domain_name} transfer code is wrong" } | ||
end | ||
else | ||
errors << { title: "#{domain_name} does not exist" } | ||
end | ||
end | ||
|
||
if errors.none? | ||
status 204 | ||
body false | ||
@response = {} | ||
else | ||
status 400 | ||
@response = { errors: errors } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
#= require jquery | ||
#= require jquery_ujs | ||
#= require jquery.validate | ||
#= require jquery.validate.additional-methods | ||
#= require turbolinks | ||
#= require bootstrap-sprockets | ||
#= require jquery.nested_attributes | ||
#= require shared/jquery.validate.bootstrap | ||
#= require jquery-ui/datepicker | ||
#= require select2 | ||
#= require datepicker | ||
#= require shared/general | ||
#= require registrar/application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,6 @@ | |
.required:after | ||
content: "*" | ||
margin: 0 0 0 1px | ||
|
||
.tab-content | ||
padding-top: 15px |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.