diff options
Diffstat (limited to 'app/graphql/mutations/snippets/update.rb')
-rw-r--r-- | app/graphql/mutations/snippets/update.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/graphql/mutations/snippets/update.rb b/app/graphql/mutations/snippets/update.rb index 2e1382e1cb1..792c631e5ca 100644 --- a/app/graphql/mutations/snippets/update.rb +++ b/app/graphql/mutations/snippets/update.rb @@ -34,7 +34,9 @@ module Mutations process_args_for_params!(args) - service_response = ::Snippets::UpdateService.new(project: snippet.project, current_user: current_user, params: args).execute(snippet) + spam_params = ::Spam::SpamParams.new_from_request(request: context[:request]) + service = ::Snippets::UpdateService.new(project: snippet.project, current_user: current_user, params: args, spam_params: spam_params) + service_response = service.execute(snippet) # TODO: DRY this up - From here down, this is all duplicated with Mutations::Snippets::Create#resolve, except for # `snippet.reset`, which is required in order to return the object in its non-dirty, unmodified, database state @@ -62,12 +64,6 @@ module Mutations def process_args_for_params!(args) convert_blob_actions_to_snippet_actions!(args) - if Feature.enabled?(:snippet_spam) - args.merge!(additional_spam_params) - else - args[:disable_spam_action_service] = true - end - # Return nil to make it explicit that this method is mutating the args parameter, and that # the return value is not relevant and is not to be used. nil |