-
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 branch 'master' into enable-trimming-dnskey
- Loading branch information
Showing
70 changed files
with
1,103 additions
and
478 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
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
40 changes: 40 additions & 0 deletions
40
app/controllers/api/v1/accreditation_center/results_controller.rb
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,40 @@ | ||
require 'serializers/repp/contact' | ||
|
||
module Api | ||
module V1 | ||
module AccreditationCenter | ||
class ResultsController < ::Api::V1::AccreditationCenter::BaseController | ||
def show | ||
accr_users = [] | ||
registrar = Registrar.find_by(name: params[:registrar_name]) | ||
|
||
return render json: { errors: 'Registrar not found' }, status: :not_found if registrar.nil? | ||
|
||
registrar.api_users.where.not(accreditation_date: nil).each do |u| | ||
accr_users << u | ||
end | ||
|
||
render json: { code: 1000, registrar_users: accr_users } | ||
end | ||
|
||
def show_api_user | ||
user_api = User.find_by(username: params[:username], identity_code: params[:identity_code]) | ||
|
||
return render json: { errors: 'User not found' }, status: :not_found if user_api.nil? | ||
|
||
return render json: { errors: 'No accreditated yet' }, status: :not_found if user_api.accreditation_date.nil? | ||
|
||
render json: { code: 1000, user_api: user_api } | ||
end | ||
|
||
def list_accreditated_api_users | ||
users = User.where.not(accreditation_date: nil) | ||
|
||
return render json: { errors: 'Accreditated users not found' }, status: :not_found if users.empty? | ||
|
||
render json: { code: 1000, users: users } | ||
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
Oops, something went wrong.