summaryrefslogtreecommitdiff
path: root/app/services/issues
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-01-24 17:48:09 -0600
committerFatih Acet <acetfatih@gmail.com>2019-01-30 23:18:18 +0100
commitec66cf0a17060f8417eb261ef3770db558c35373 (patch)
tree6db2b42e5b73f45d92de52cd01d90c421378c11c /app/services/issues
parent56506ff82f51efc6c05100ddceb5ea37b04343ad (diff)
downloadgitlab-ce-ec66cf0a17060f8417eb261ef3770db558c35373.tar.gz
Raise exception if we can't match the update_task
and some additional refactoring
Diffstat (limited to 'app/services/issues')
-rw-r--r--app/services/issues/update_service.rb27
1 files changed, 1 insertions, 26 deletions
diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb
index 9c7b8fcc6ab..cec5b5734c0 100644
--- a/app/services/issues/update_service.rb
+++ b/app/services/issues/update_service.rb
@@ -8,7 +8,7 @@ module Issues
handle_move_between_ids(issue)
filter_spam_check_params
change_issue_duplicate(issue)
- move_issue_to_new_project(issue) || task_change_event(issue) || update(issue)
+ move_issue_to_new_project(issue) || update_task_event(issue) || update(issue)
end
def update(issue)
@@ -125,31 +125,6 @@ module Issues
end
end
- def task_change_event(issue)
- update_task_params = params.delete(:update_task)
- return unless update_task_params
-
- toggler = TaskListToggleService.new(issue.description, issue.description_html,
- index: update_task_params[:index],
- currently_checked: !update_task_params[:checked],
- line_source: update_task_params[:line_source],
- line_number: update_task_params[:line_number])
-
- if toggler.execute
- # by updating the description_html field at the same time,
- # the markdown cache won't be considered invalid
- params[:description] = toggler.updated_markdown
- params[:description_html] = toggler.updated_markdown_html
-
- # since we're updating a very specific line, we don't care whether
- # the `lock_version` sent from the FE is the same or not. Just
- # make sure the data hasn't changed since we queried it
- params[:lock_version] = issue.lock_version
-
- update_task(issue)
- end
- end
-
# rubocop: disable CodeReuse/ActiveRecord
def get_issue_if_allowed(id, board_group_id = nil)
return unless id