2020-10-24 23:57:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Boards
|
|
|
|
module Lists
|
2021-06-08 01:23:25 +05:30
|
|
|
class Update < BaseUpdate
|
2020-10-24 23:57:45 +05:30
|
|
|
graphql_name 'UpdateBoardList'
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
argument :list_id, Types::GlobalIDType[List],
|
2020-10-24 23:57:45 +05:30
|
|
|
required: true,
|
|
|
|
loads: Types::BoardListType,
|
|
|
|
description: 'Global ID of the list.'
|
|
|
|
|
|
|
|
field :list,
|
|
|
|
Types::BoardListType,
|
|
|
|
null: true,
|
2021-03-08 18:12:59 +05:30
|
|
|
description: 'Mutated list.'
|
2020-10-24 23:57:45 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def update_list(list, args)
|
|
|
|
service = ::Boards::Lists::UpdateService.new(list.board, current_user, args)
|
|
|
|
service.execute(list)
|
|
|
|
end
|
|
|
|
|
|
|
|
def can_read_list?(list)
|
2021-04-17 20:07:23 +05:30
|
|
|
Ability.allowed?(current_user, :read_issue_board_list, list.board)
|
2020-10-24 23:57:45 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|