Welcome to mirror list, hosted at ThFree Co, Russian Federation.

delete.rb « pipeline_schedule « ci « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ead9a43161d8a9e0f72bb1faf10148c6730dbea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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