summaryrefslogtreecommitdiff
path: root/lib/api/todos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r--lib/api/todos.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index a90a667fafe..19df13d8aac 100644
--- a/lib/api/todos.rb
+++ b/lib/api/todos.rb
@@ -61,9 +61,9 @@ module API
#
delete ':id' do
todo = current_user.todos.find(params[:id])
- todo.done
+ TodoService.new.mark_todos_as_done([todo], current_user)
- present todo, with: Entities::Todo, current_user: current_user
+ present todo.reload, with: Entities::Todo, current_user: current_user
end
# Mark all todos as done
@@ -74,8 +74,6 @@ module API
delete do
todos = find_todos
TodoService.new.mark_todos_as_done(todos, current_user)
-
- todos.length
end
end
end