diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-20 20:32:44 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-28 08:32:39 +0100 |
commit | c280acb00b3d4f3e071bfd36eecc8fffcebc2bb2 (patch) | |
tree | f806ba67c4c22945d8a9e6a66c108d3d37e9bd65 /lib/api/v3/boards.rb | |
parent | f2dd2604134ac62301db765ff0b14ff692e21bd6 (diff) | |
download | gitlab-ce-c280acb00b3d4f3e071bfd36eecc8fffcebc2bb2.tar.gz |
Backport API to V3
Diffstat (limited to 'lib/api/v3/boards.rb')
-rw-r--r-- | lib/api/v3/boards.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/api/v3/boards.rb b/lib/api/v3/boards.rb index 31d708bc2c8..b1c2a3c59f2 100644 --- a/lib/api/v3/boards.rb +++ b/lib/api/v3/boards.rb @@ -44,6 +44,27 @@ module API authorize!(:read_board, user_project) present board_lists, with: ::API::Entities::List end + + desc 'Delete a board list' do + detail 'This feature was introduced in 8.13' + success ::API::Entities::List + end + params do + requires :list_id, type: Integer, desc: 'The ID of a board list' + 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) + + if service.execute(list) + present list, with: ::API::Entities::List + else + render_api_error!({ error: 'List could not be deleted!' }, 400) + end + end end end end |