debian-mirror-gitlab/app/graphql/mutations/ci/pipeline_schedule/take_ownership.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
699 B
Ruby
Raw Normal View History

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