diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-20 20:17:42 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-20 20:17:42 +0800 |
commit | e9862a9900c6269a41b65ca543035e57b49fede3 (patch) | |
tree | c2ed1f1a906ccb240f8a27d28e2b86ffdddbf3f1 /lib/api | |
parent | c9c715cd5510456d83da5272f28b7ce7f248c77f (diff) | |
download | gitlab-ce-e9862a9900c6269a41b65ca543035e57b49fede3.tar.gz |
Use struct instead of hash
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/triggers.rb | 2 | ||||
-rw-r--r-- | lib/api/v3/triggers.rb | 4 |
2 files changed, 3 insertions, 3 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 |