diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/triggers.rb | 2 | ||||
-rw-r--r-- | lib/api/v3/triggers.rb | 4 | ||||
-rw-r--r-- | lib/ci/api/triggers.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb index 55528101f15..280fe72ae47 100644 --- a/lib/api/triggers.rb +++ b/lib/api/triggers.rb @@ -28,7 +28,7 @@ module API # create request and trigger builds result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref].to_s, variables) - pipeline = result[:pipeline] + 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 0e236423b8c..e9d4c35307b 100644 --- a/lib/api/v3/triggers.rb +++ b/lib/api/v3/triggers.rb @@ -29,10 +29,10 @@ module API # create request and trigger builds result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref].to_s, variables) - pipeline = result[:pipeline] + pipeline = result.pipeline if pipeline.persisted? - present result[: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 ce0ef95b186..6225203f223 100644 --- a/lib/ci/api/triggers.rb +++ b/lib/ci/api/triggers.rb @@ -25,10 +25,10 @@ module Ci # create request and trigger builds result = Ci::CreateTriggerRequestService.execute(project, trigger, params[:ref], variables) - pipeline = result[:pipeline] + pipeline = result.pipeline if pipeline.persisted? - present result[:trigger_request], with: Entities::TriggerRequest + present result.trigger_request, with: Entities::TriggerRequest else render_validation_error!(pipeline) end |