diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/triggers.rb | 4 | ||||
-rw-r--r-- | lib/api/v3/triggers.rb | 6 |
2 files changed, 5 insertions, 5 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 |