summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-04-29 17:47:56 +0000
committerRobert Speicher <robert@gitlab.com>2017-04-29 17:47:56 +0000
commit03f13af588cf2b578a27717db492c216fcafbf9a (patch)
tree1b913d761b84fe3251e216713c67e640967d1522 /lib/api
parent3717d21db1b17b2e18e6843d41a2c23d006918e9 (diff)
parent303504df4788fead8ab200dd5490658489ba5385 (diff)
downloadgitlab-ce-03f13af588cf2b578a27717db492c216fcafbf9a.tar.gz
Merge branch 'revert-c3c465ac' into 'master'
Revert "Merge branch 'tc-no-todo-service-select' into 'master'" See merge request !10997
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/todos.rb4
-rw-r--r--lib/api/v3/todos.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 10aa64947fe..d1f7e364029 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -59,10 +59,10 @@ module API
requires :id, type: Integer, desc: 'The ID of the todo being marked as done'
end
post ':id/mark_as_done' do
- TodoService.new.mark_todos_as_done_by_ids(params[:id], current_user)
todo = current_user.todos.find(params[:id])
+ TodoService.new.mark_todos_as_done([todo], current_user)
- present todo, with: ::API::Entities::Todo, current_user: current_user
+ present todo.reload, with: Entities::Todo, current_user: current_user
end
desc 'Mark all todos as done'
diff --git a/lib/api/v3/todos.rb b/lib/api/v3/todos.rb
index 3e2c61f6dbd..e3b311d61cd 100644
--- a/lib/api/v3/todos.rb
+++ b/lib/api/v3/todos.rb
@@ -11,10 +11,10 @@ module API
requires :id, type: Integer, desc: 'The ID of the todo being marked as done'
end
delete ':id' do
- TodoService.new.mark_todos_as_done_by_ids(params[:id], current_user)
todo = current_user.todos.find(params[:id])
+ TodoService.new.mark_todos_as_done([todo], current_user)
- present todo, with: ::API::Entities::Todo, current_user: current_user
+ present todo.reload, with: ::API::Entities::Todo, current_user: current_user
end
desc 'Mark all todos as done'