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 /lib/api/todos.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r-- | lib/api/todos.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb index 02b8bb55274..e36ddf21277 100644 --- a/lib/api/todos.rb +++ b/lib/api/todos.rb @@ -6,8 +6,6 @@ module API before { authenticate! } - helpers ::Gitlab::IssuableMetadata - ISSUABLE_TYPES = { 'merge_requests' => ->(iid) { find_merge_request_with_access(iid) }, 'issues' => ->(iid) { find_project_issue(iid) } @@ -65,7 +63,7 @@ module API next unless collection targets = collection.map(&:target) - options[type] = { issuable_metadata: issuable_meta_data(targets, type, current_user) } + options[type] = { issuable_metadata: Gitlab::IssuableMetadata.new(current_user, targets).data } end end end @@ -91,16 +89,18 @@ module API requires :id, type: Integer, desc: 'The ID of the todo being marked as done' end post ':id/mark_as_done' do - 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: :api_done) + present todo, with: Entities::Todo, current_user: current_user end desc 'Mark all todos as done' post '/mark_as_done' do todos = find_todos - TodoService.new.mark_todos_as_done(todos, current_user) + + TodoService.new.resolve_todos(todos, current_user, resolved_by_action: :api_all_done) no_content! end |