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.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb
index 2a6bfa98ca4..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
@@ -73,9 +73,7 @@ module API
#
delete do
todos = find_todos
- todos.each(&:done)
-
- present paginate(Kaminari.paginate_array(todos)), with: Entities::Todo, current_user: current_user
+ TodoService.new.mark_todos_as_done(todos, current_user)
end
end
end