Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@@ -10,12 +10,13 @@ module ExerciseService
def execute
response = connection.post do |req|
req.headers['Content-Type'] = 'application/json'
req.headers['Authorization'] = 'Bearer ' + @codeharbor_link.api_key
req.headers['Authorization'] = "Bearer #{@codeharbor_link.api_key}"
req.body = {uuid: @uuid}.to_json
end
response_hash = JSON.parse(response.body, symbolize_names: true).slice(:exercise_found, :update_right)
{error: false, message: message(response_hash[:exercise_found], response_hash[:update_right])}.merge(response_hash)
{error: false,
message: message(response_hash[:exercise_found], response_hash[:update_right])}.merge(response_hash)
rescue Faraday::Error, JSON::ParserError
{error: true, message: I18n.t('exercises.export_codeharbor.error')}
end