summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/boards/lists_controller.rb4
-rw-r--r--app/services/boards/lists/list_service.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/projects/boards/lists_controller.rb b/app/controllers/projects/boards/lists_controller.rb
index fbfabd86575..ad53bb749a0 100644
--- a/app/controllers/projects/boards/lists_controller.rb
+++ b/app/controllers/projects/boards/lists_controller.rb
@@ -5,9 +5,9 @@ module Projects
before_action :authorize_read_list!, only: [:index]
def index
- board.lists.create(list_type: :backlog) unless board.lists.backlog.any?
+ lists = ::Boards::Lists::ListService.new(project, current_user).execute(board)
- render json: serialize_as_json(board.lists)
+ render json: serialize_as_json(lists)
end
def create
diff --git a/app/services/boards/lists/list_service.rb b/app/services/boards/lists/list_service.rb
index c579ed4c869..4ec56c3ac4d 100644
--- a/app/services/boards/lists/list_service.rb
+++ b/app/services/boards/lists/list_service.rb
@@ -2,6 +2,8 @@ module Boards
module Lists
class ListService < BaseService
def execute(board)
+ board.lists.create(list_type: :backlog) unless board.lists.backlog.any?
+
board.lists
end
end