Merge pull request #722 from internetee/registry-693

REST API: Return successful domain transfers
This commit is contained in:
Timo Võhmar 2018-02-28 16:33:45 +02:00 committed by GitHub
commit 7c45a85cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 12 deletions

View file

@ -51,11 +51,13 @@ class Registrar
end
end
if response.code == '204'
flash[:notice] = t '.transferred'
parsed_response = JSON.parse(response.body, symbolize_names: true)
if response.code == '200'
flash[:notice] = t '.transferred', count: parsed_response[:data].size
redirect_to registrar_domains_url
else
@api_errors = JSON.parse(response.body, symbolize_names: true)[:errors]
@api_errors = parsed_response[:errors]
render :new
end
else