Commit f6a8894a authored by Shinya Maeda's avatar Shinya Maeda

Expose last_pipeline only when detailed status

parent 92bc1dda
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment