summaryrefslogtreecommitdiff
path: root/lib/api/boards.rb
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2017-09-06 14:35:58 +1000
committerSimon Knox <psimyn@gmail.com>2017-09-06 14:35:58 +1000
commitb9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5 (patch)
treeb7770180f178086c78ef2ca25d6bb2267f739110 /lib/api/boards.rb
parent74740604211dab6632771f1bfd7dd67902fea7ef (diff)
parentd68ff7f50a93ebbff537b5e795cf6bf80bd66a6e (diff)
downloadgitlab-ce-b9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ee_issue_928_backport
Diffstat (limited to 'lib/api/boards.rb')
-rw-r--r--lib/api/boards.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/boards.rb b/lib/api/boards.rb
index 5a2d7a681e3..366b0dc9a6f 100644
--- a/lib/api/boards.rb
+++ b/lib/api/boards.rb
@@ -7,7 +7,7 @@ module API
params do
requires :id, type: String, desc: 'The ID of a project'
end
- resource :projects, requirements: { id: %r{[^/]+} } do
+ resource :projects, requirements: API::PROJECT_ENDPOINT_REQUIREMENTS do
desc 'Get all project boards' do
detail 'This feature was introduced in 8.13'
success Entities::Board
@@ -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