diff options
Diffstat (limited to 'app/controllers/concerns/boards_actions.rb')
-rw-r--r-- | app/controllers/concerns/boards_actions.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/concerns/boards_actions.rb b/app/controllers/concerns/boards_actions.rb index b382e338a78..79e6f027c2f 100644 --- a/app/controllers/concerns/boards_actions.rb +++ b/app/controllers/concerns/boards_actions.rb @@ -34,16 +34,26 @@ module BoardsActions def boards strong_memoize(:boards) do - Boards::ListService.new(parent, current_user).execute + existing_boards = boards_finder.execute + if existing_boards.any? + existing_boards + else + # if no board exists, create one + [board_create_service.execute.payload] + end end end def board strong_memoize(:board) do - boards.find(params[:id]) + board_finder.execute.first end end + def board_type + board_klass.to_type + end + def serializer BoardSerializer.new(current_user: current_user) end |