mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
updated set_test_date_to_api_user method
This commit is contained in:
parent
cfe1059c5f
commit
46b1c7d057
1 changed files with 7 additions and 5 deletions
|
@ -52,18 +52,20 @@ module Admin
|
|||
|
||||
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
||||
|
||||
if response.code == "200"
|
||||
case response.code
|
||||
when "200"
|
||||
result = JSON.parse(response.body)
|
||||
demo_user_api = result['user_api']
|
||||
|
||||
Actions::RecordDateOfTest.record_result_to_api_user(api_user:user_api,
|
||||
date: demo_user_api['accreditation_date']) unless demo_user_api.empty?
|
||||
return redirect_to request.referrer, notice: 'User Api found'
|
||||
else
|
||||
return redirect_to request.referrer, notice: 'User Api no found or not accriditated yet'
|
||||
end
|
||||
|
||||
redirect_to request.referrer, notice: 'Something goes wrong'
|
||||
redirect_to request.referrer, notice: 'User Api found'
|
||||
when "404"
|
||||
redirect_to request.referrer, notice: 'User Api not found or not accredited yet'
|
||||
else
|
||||
redirect_to request.referrer, notice: 'Something went wrong'
|
||||
end
|
||||
end
|
||||
|
||||
def remove_test_date_to_api_user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue