summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/todos/restore.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/todos/restore.rb')
-rw-r--r--app/graphql/mutations/todos/restore.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/graphql/mutations/todos/restore.rb b/app/graphql/mutations/todos/restore.rb
index c4597bd84a2..a0a1772db0a 100644
--- a/app/graphql/mutations/todos/restore.rb
+++ b/app/graphql/mutations/todos/restore.rb
@@ -18,7 +18,7 @@ module Mutations
def resolve(id:)
todo = authorized_find!(id: id)
- restore(todo.id) if todo.done?
+ restore(todo)
{
todo: todo.reset,
@@ -28,8 +28,8 @@ module Mutations
private
- def restore(id)
- TodoService.new.mark_todos_as_pending_by_ids([id], current_user)
+ def restore(todo)
+ TodoService.new.restore_todo(todo, current_user)
end
end
end