2020-10-24 23:57:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Boards
|
|
|
|
module Lists
|
2021-03-11 19:13:27 +05:30
|
|
|
class Create < BaseCreate
|
2020-10-24 23:57:45 +05:30
|
|
|
graphql_name 'BoardListCreate'
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
argument :board_id, ::Types::GlobalIDType[::Board],
|
|
|
|
required: true,
|
|
|
|
description: 'Global ID of the issue board to mutate.'
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
field :list,
|
|
|
|
Types::BoardListType,
|
|
|
|
null: true,
|
|
|
|
description: 'Issue list in the issue board.'
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
authorize :admin_issue_board_list
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
private
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
def find_object(id:)
|
|
|
|
GitlabSchema.object_from_id(id, expected_type: ::Board)
|
2020-10-24 23:57:45 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def create_list(board, params)
|
|
|
|
create_list_service =
|
|
|
|
::Boards::Lists::CreateService.new(board.resource_parent, current_user, params)
|
|
|
|
|
|
|
|
create_list_service.execute(board)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Mutations::Boards::Lists::Create.prepend_mod_with('Mutations::Boards::Lists::Create')
|