diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/controllers/dashboard/todos_controller.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/controllers/dashboard/todos_controller.rb')
-rw-r--r-- | app/controllers/dashboard/todos_controller.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb index ebee8e9094e..8a8064b24c2 100644 --- a/app/controllers/dashboard/todos_controller.rb +++ b/app/controllers/dashboard/todos_controller.rb @@ -17,7 +17,9 @@ class Dashboard::TodosController < Dashboard::ApplicationController end def destroy - TodoService.new.mark_todos_as_done_by_ids(params[:id], current_user) + todo = current_user.todos.find(params[:id]) + + TodoService.new.resolve_todo(todo, current_user, resolved_by_action: :mark_done) respond_to do |format| format.html do @@ -31,7 +33,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController end def destroy_all - updated_ids = TodoService.new.mark_todos_as_done(@todos, current_user) + updated_ids = TodoService.new.resolve_todos(@todos, current_user, resolved_by_action: :mark_all_done) respond_to do |format| format.html { redirect_to dashboard_todos_path, status: :found, notice: _('Everything on your to-do list is marked as done.') } @@ -41,13 +43,13 @@ class Dashboard::TodosController < Dashboard::ApplicationController end def restore - TodoService.new.mark_todos_as_pending_by_ids(params[:id], current_user) + TodoService.new.restore_todo(current_user.todos.find(params[:id]), current_user) render json: todos_counts end def bulk_restore - TodoService.new.mark_todos_as_pending_by_ids(params[:ids], current_user) + TodoService.new.restore_todos(current_user.todos.for_ids(params[:ids]), current_user) render json: todos_counts end |