Commit 8743f765 authored by Shinya Maeda's avatar Shinya Maeda

Use CreatePipelineScheduleService

parent 97bf2401
......@@ -51,8 +51,9 @@ module API
authenticate!
authorize! :create_pipeline_schedule, user_project
pipeline_schedule = user_project.pipeline_schedules.create(
declared_params(include_missing: false).merge(owner: current_user))
pipeline_schedule = Ci::CreatePipelineScheduleService
.new(user_project, current_user, declared_params(include_missing: false))
.execute
if pipeline_schedule.valid?
present pipeline_schedule, with: Entities::PipelineSchedule
......
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