summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/snippets/create.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/snippets/create.rb')
-rw-r--r--app/graphql/mutations/snippets/create.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb
index d1ad0697acd..765163e73a1 100644
--- a/app/graphql/mutations/snippets/create.rb
+++ b/app/graphql/mutations/snippets/create.rb
@@ -49,7 +49,9 @@ module Mutations
process_args_for_params!(args)
- service_response = ::Snippets::CreateService.new(project: project, current_user: current_user, params: args).execute
+ spam_params = ::Spam::SpamParams.new_from_request(request: context[:request])
+ service = ::Snippets::CreateService.new(project: project, current_user: current_user, params: args, spam_params: spam_params)
+ service_response = service.execute
# Only when the user is not an api user and the operation was successful
if !api_user? && service_response.success?
@@ -81,12 +83,6 @@ module Mutations
# it's the expected key param
args[:files] = args.delete(:uploaded_files)
- 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