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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/boards/lists_controller.rb')
-rw-r--r--app/controllers/boards/lists_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/boards/lists_controller.rb b/app/controllers/boards/lists_controller.rb
index aecd287370f..19a4508c061 100644
--- a/app/controllers/boards/lists_controller.rb
+++ b/app/controllers/boards/lists_controller.rb
@@ -19,12 +19,12 @@ module Boards
end
def create
- list = Boards::Lists::CreateService.new(board.resource_parent, current_user, create_list_params).execute(board)
+ response = Boards::Lists::CreateService.new(board.resource_parent, current_user, create_list_params).execute(board)
- if list.valid?
- render json: serialize_as_json(list)
+ if response.success?
+ render json: serialize_as_json(response.payload[:list])
else
- render json: list.errors, status: :unprocessable_entity
+ render json: { errors: response.errors }, status: :unprocessable_entity
end
end