diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/graphql/mutations/boards/lists/create.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/graphql/mutations/boards/lists/create.rb')
-rw-r--r-- | app/graphql/mutations/boards/lists/create.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/app/graphql/mutations/boards/lists/create.rb b/app/graphql/mutations/boards/lists/create.rb index 3fe1052315f..f6df63365b2 100644 --- a/app/graphql/mutations/boards/lists/create.rb +++ b/app/graphql/mutations/boards/lists/create.rb @@ -27,30 +27,16 @@ module Mutations board = authorized_find!(id: args[:board_id]) params = create_list_params(args) - authorize_list_type_resource!(board, params) - - list = create_list(board, params) + response = create_list(board, params) { - list: list.valid? ? list : nil, - errors: errors_on_object(list) + list: response.success? ? response.payload[:list] : nil, + errors: response.errors } end private - # Overridden in EE - def authorize_list_type_resource!(board, params) - return unless params[:label_id] - - labels = ::Labels::AvailableLabelsService.new(current_user, board.resource_parent, params) - .filter_labels_ids_in_param(:label_id) - - unless labels.present? - raise Gitlab::Graphql::Errors::ArgumentError, 'Label not found!' - end - end - def create_list(board, params) create_list_service = ::Boards::Lists::CreateService.new(board.resource_parent, current_user, params) |