Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-09 18:12:59 +0300
committerPhil Hughes <me@iamphill.com>2016-06-14 10:36:07 +0300
commit16970d07e84f5967eccd928c9f9d9d7b027e91ac (patch)
tree77e73edae67682582df676fcd73b53917c2776eb /app/controllers/projects/todos_controller.rb
parent8abd7b35ff20214c072658a4e92e0418ae9e936a (diff)
Returns created todos to control rather than re-query
Diffstat (limited to 'app/controllers/projects/todos_controller.rb')
-rw-r--r--app/controllers/projects/todos_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/todos_controller.rb b/app/controllers/projects/todos_controller.rb
index 64e70a5bcc6..a51bd5e2b49 100644
--- a/app/controllers/projects/todos_controller.rb
+++ b/app/controllers/projects/todos_controller.rb
@@ -1,9 +1,9 @@
class Projects::TodosController < Projects::ApplicationController
def create
- TodoService.new.mark_todo(issuable, current_user)
+ todos = TodoService.new.mark_todo(issuable, current_user)
render json: {
- todo: current_user.todos.find_by(state: :pending, action: Todo::MARKED, target_id: issuable.id),
+ todo: todos,
count: current_user.todos.pending.count,
}
end