diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/triggers.rb | 4 | ||||
-rw-r--r-- | lib/api/v3/triggers.rb | 6 | ||||
-rw-r--r-- | lib/ci/api/triggers.rb | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb index 9e444563fdf..55528101f15 100644 --- a/lib/api/triggers.rb +++ b/lib/api/triggers.rb @@ -27,8 +27,8 @@ module API end # create request and trigger builds - trigger_request = Ci::CreateTriggerRequestService.new.execute(project, trigger, params[:ref].to_s, variables) - pipeline = trigger_request.pipeline + result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref].to_s, variables) + pipeline = result[:pipeline] if pipeline.persisted? present pipeline, with: Entities::Pipeline diff --git a/lib/api/v3/triggers.rb b/lib/api/v3/triggers.rb index 7e75c579528..0e236423b8c 100644 --- a/lib/api/v3/triggers.rb +++ b/lib/api/v3/triggers.rb @@ -28,11 +28,11 @@ module API end # create request and trigger builds - trigger_request = Ci::CreateTriggerRequestService.new.execute(project, trigger, params[:ref].to_s, variables) - pipeline = trigger_request.pipeline + result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref].to_s, variables) + pipeline = result[:pipeline] if pipeline.persisted? - present trigger_request, with: ::API::V3::Entities::TriggerRequest + present result[:trigger_request], with: ::API::V3::Entities::TriggerRequest else render_validation_error!(pipeline) end diff --git a/lib/ci/api/triggers.rb b/lib/ci/api/triggers.rb index 0e5174e13ab..ce0ef95b186 100644 --- a/lib/ci/api/triggers.rb +++ b/lib/ci/api/triggers.rb @@ -24,11 +24,11 @@ module Ci end # create request and trigger builds - trigger_request = Ci::CreateTriggerRequestService.new.execute(project, trigger, params[:ref], variables) - pipeline = trigger_request.pipeline + result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref], variables) + pipeline = result[:pipeline] if pipeline.persisted? - present trigger_request, with: Entities::TriggerRequest + present result[:trigger_request], with: Entities::TriggerRequest else render_validation_error!(pipeline) end |