gitlab-org--gitlab-foss/app/graphql/mutations/ci/pipeline_schedule/delete.rb

28 lines
522 B
Ruby

# frozen_string_literal: true
module Mutations
module Ci
module PipelineSchedule
class Delete < Base
graphql_name 'PipelineScheduleDelete'
authorize :admin_pipeline_schedule
def resolve(id:)
schedule = authorized_find!(id: id)
if schedule.destroy
{
errors: []
}
else
{
errors: ['Failed to remove the pipeline schedule']
}
end
end
end
end
end
end