summaryrefslogtreecommitdiff
path: root/lib/api/boards.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-30 16:49:22 +0100
committerPhil Hughes <me@iamphill.com>2017-08-30 16:49:22 +0100
commit4d2d744ae9a2d4c3bb0f00805c27704b79e00d72 (patch)
tree839b1c3ab4c09c80f7d643fe69dae8a83c4e4eb4 /lib/api/boards.rb
parent25a3b7fab905d09f6f064108f457a4e20c8915ff (diff)
parentf7c8434c7100c3c87eb2a75cd5a128e520d8c110 (diff)
downloadgitlab-ce-enable-new-navigaton-by-default.tar.gz
Merge branch 'master' into enable-new-navigaton-by-defaultenable-new-navigaton-by-default
Diffstat (limited to 'lib/api/boards.rb')
-rw-r--r--lib/api/boards.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/boards.rb b/lib/api/boards.rb
index 5a2d7a681e3..0d11c5fc971 100644
--- a/lib/api/boards.rb
+++ b/lib/api/boards.rb
@@ -122,13 +122,13 @@ module API
end
delete "/lists/:list_id" do
authorize!(:admin_list, user_project)
-
list = board_lists.find(params[:list_id])
- service = ::Boards::Lists::DestroyService.new(user_project, current_user)
-
- unless service.execute(list)
- render_api_error!({ error: 'List could not be deleted!' }, 400)
+ destroy_conditionally!(list) do |list|
+ service = ::Boards::Lists::DestroyService.new(user_project, current_user)
+ unless service.execute(list)
+ render_api_error!({ error: 'List could not be deleted!' }, 400)
+ end
end
end
end