diff options
author | Stan Hu <stanhu@gmail.com> | 2017-08-31 20:50:05 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-08-31 20:50:05 -0700 |
commit | f045903541ace5cf4fd3c6e4a05ecfd264c1c621 (patch) | |
tree | ee6aaf013d92766e7184b3e0772e1e5fa99a20e4 /lib/api/boards.rb | |
parent | f2c60eba25fc001974a61373bc380528416932a2 (diff) | |
parent | 8713afe61fb1beaff4d550a60b88d274c47006ea (diff) | |
download | gitlab-ce-f045903541ace5cf4fd3c6e4a05ecfd264c1c621.tar.gz |
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'lib/api/boards.rb')
-rw-r--r-- | lib/api/boards.rb | 10 |
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 |