summaryrefslogtreecommitdiff
path: root/lib/api/v3
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-05 01:22:57 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-05 01:22:57 +0900
commit48f017d1e84498eec38d276d94918021a985bfee (patch)
treeadbe1d89e597b4de487e1b9bcdb596887c0e9bbb /lib/api/v3
parent209549c95fb0d4ba3196cc8ed888f7c024216ebb (diff)
downloadgitlab-ce-48f017d1e84498eec38d276d94918021a985bfee.tar.gz
Diffstat (limited to 'lib/api/v3')
-rw-r--r--lib/api/v3/triggers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/v3/triggers.rb b/lib/api/v3/triggers.rb
index 13cfb9fe38b..534911fde5c 100644
--- a/lib/api/v3/triggers.rb
+++ b/lib/api/v3/triggers.rb
@@ -32,12 +32,12 @@ module API
render_api_error!(result[:message], result[:http_status])
else
pipeline = result[:pipeline]
- trigger_request = Ci::TriggerRequest.find_by(commit_id: pipeline.id)
# We switched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# Ci::TriggerRequest doesn't save variables anymore.
# Here is copying Ci::PipelineVariable to Ci::TriggerRequest.variables for presenting the variables.
# The same endpoint in v4 API pressents Pipeline instead of TriggerRequest, so it doesn't need such a process.
+ trigger_request = pipeline.trigger_requests.last
trigger_request.variables = params[:variables]
present trigger_request, with: ::API::V3::Entities::TriggerRequest