diff options
Diffstat (limited to 'app/graphql/mutations/snippets/create.rb')
-rw-r--r-- | app/graphql/mutations/snippets/create.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb index 7f2dd448b8b..e9b45294659 100644 --- a/app/graphql/mutations/snippets/create.rb +++ b/app/graphql/mutations/snippets/create.rb @@ -5,6 +5,7 @@ module Mutations class Create < BaseMutation include ServiceCompatibility include CanMutateSpammable + include Mutations::SpamProtection authorize :create_snippet @@ -56,12 +57,12 @@ module Mutations end snippet = service_response.payload[:snippet] - with_spam_action_response_fields(snippet) do - { - snippet: service_response.success? ? snippet : nil, - errors: errors_on_object(snippet) - } - end + check_spam_action_response!(snippet) + + { + snippet: service_response.success? ? snippet : nil, + errors: errors_on_object(snippet) + } end private |