diff options
Diffstat (limited to 'app/graphql/mutations/ci/job/retry.rb')
-rw-r--r-- | app/graphql/mutations/ci/job/retry.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/graphql/mutations/ci/job/retry.rb b/app/graphql/mutations/ci/job/retry.rb index 9af357ab216..50e9c51c9e7 100644 --- a/app/graphql/mutations/ci/job/retry.rb +++ b/app/graphql/mutations/ci/job/retry.rb @@ -17,11 +17,19 @@ module Mutations job = authorized_find!(id: id) project = job.project - ::Ci::RetryBuildService.new(project, current_user).execute(job) - { - job: job, - errors: errors_on_object(job) - } + response = ::Ci::RetryJobService.new(project, current_user).execute(job) + + if response.success? + { + job: response[:job], + errors: [] + } + else + { + job: nil, + errors: [response.message] + } + end end end end |