summaryrefslogtreecommitdiff
path: root/lib/api/todos.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-02-21 10:00:33 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-21 12:01:15 +0100
commit1ef911f0e086badcb717c68cd1817c68ed8b4d8d (patch)
tree4e8f7f9a7b386b4e97b0ae6c0a8826cbd7c03de2 /lib/api/todos.rb
parentb596dd8fedd9dc8f9487e1e67a52a7b211bd956b (diff)
downloadgitlab-ce-1ef911f0e086badcb717c68cd1817c68ed8b4d8d.tar.gz
API: Use POST requests to mark todos as done
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r--lib/api/todos.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 9bd077263a7..0b9650b296c 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -58,7 +58,7 @@ module API
params do
requires :id, type: Integer, desc: 'The ID of the todo being marked as done'
end
- delete ':id' do
+ post ':id/mark_as_done' do
todo = current_user.todos.find(params[:id])
TodoService.new.mark_todos_as_done([todo], current_user)
@@ -66,9 +66,11 @@ module API
end
desc 'Mark all todos as done'
- delete do
+ post '/mark_as_done' do
todos = find_todos
TodoService.new.mark_todos_as_done(todos, current_user)
+
+ no_content!
end
end
end