summaryrefslogtreecommitdiff
path: root/app/services/boards/destroy_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/boards/destroy_service.rb')
-rw-r--r--app/services/boards/destroy_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/services/boards/destroy_service.rb b/app/services/boards/destroy_service.rb
index ea0c1394aa3..8f3d4b58b7b 100644
--- a/app/services/boards/destroy_service.rb
+++ b/app/services/boards/destroy_service.rb
@@ -3,9 +3,13 @@
module Boards
class DestroyService < Boards::BaseService
def execute(board)
- return false if parent.boards.size == 1
+ if parent.boards.size == 1
+ return ServiceResponse.error(message: "The board could not be deleted, because the parent doesn't have any other boards.")
+ end
- board.destroy
+ board.destroy!
+
+ ServiceResponse.success
end
end
end