summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-19 02:42:23 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-30 23:55:09 +0900
commitf6a8894a5928e1cc37d8301c555fcfd5953cc180 (patch)
treedb9827840f7f8d0ac6d64cf0f66d3e18e3468549 /lib
parent92bc1ddaf5a256a5e6636bc4a6f8ebd8673ec719 (diff)
downloadgitlab-ce-f6a8894a5928e1cc37d8301c555fcfd5953cc180.tar.gz
Expose last_pipeline only when detailed status
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/pipeline_schedules.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index f0260cf03f3..d779cd2a294 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -690,7 +690,7 @@ module API
expose :id
expose :description, :ref, :cron, :cron_timezone, :next_run_at, :active
expose :created_at, :updated_at, :deleted_at
- expose :last_pipeline, using: Entities::PipelineBasic
+ expose :last_pipeline, using: Entities::PipelineBasic, if: { type: :full }
expose :owner, using: Entities::UserBasic
end
diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb
index 454237d3fbb..c013d6f316b 100644
--- a/lib/api/pipeline_schedules.rb
+++ b/lib/api/pipeline_schedules.rb
@@ -31,7 +31,7 @@ module API
return not_found!('PipelineSchedule') unless pipeline_schedule
- present pipeline_schedule, with: Entities::PipelineSchedule
+ present pipeline_schedule, with: Entities::PipelineSchedule, type: :full
end
desc 'Creates a new pipeline schedule' do
@@ -52,7 +52,7 @@ module API
.execute
if pipeline_schedule.persisted?
- present pipeline_schedule, with: Entities::PipelineSchedule
+ present pipeline_schedule, with: Entities::PipelineSchedule, type: :full
else
render_validation_error!(pipeline_schedule)
end
@@ -75,7 +75,7 @@ module API
return not_found!('PipelineSchedule') unless pipeline_schedule
if pipeline_schedule.update(declared_params(include_missing: false))
- present pipeline_schedule, with: Entities::PipelineSchedule
+ present pipeline_schedule, with: Entities::PipelineSchedule, type: :full
else
render_validation_error!(pipeline_schedule)
end
@@ -93,7 +93,7 @@ module API
return not_found!('PipelineSchedule') unless pipeline_schedule
if pipeline_schedule.own!(current_user)
- present pipeline_schedule, with: Entities::PipelineSchedule
+ present pipeline_schedule, with: Entities::PipelineSchedule, type: :full
else
render_validation_error!(pipeline_schedule)
end
@@ -110,7 +110,7 @@ module API
return not_found!('PipelineSchedule') unless pipeline_schedule
- present pipeline_schedule.destroy, with: Entities::PipelineSchedule
+ present pipeline_schedule.destroy, with: Entities::PipelineSchedule, type: :full
end
end