2023-01-13 00:05:48 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Ci
|
|
|
|
module PipelineSchedule
|
|
|
|
class TakeOwnership < Base
|
|
|
|
graphql_name 'PipelineScheduleTakeOwnership'
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
authorize :admin_pipeline_schedule
|
2023-01-13 00:05:48 +05:30
|
|
|
|
|
|
|
field :pipeline_schedule,
|
|
|
|
Types::Ci::PipelineScheduleType,
|
|
|
|
description: 'Updated pipeline schedule ownership.'
|
|
|
|
|
|
|
|
def resolve(id:)
|
|
|
|
schedule = authorized_find!(id: id)
|
|
|
|
|
|
|
|
service_response = ::Ci::PipelineSchedules::TakeOwnershipService.new(schedule, current_user).execute
|
|
|
|
{
|
|
|
|
pipeline_schedule: schedule,
|
|
|
|
errors: service_response.errors
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|