diff options
Diffstat (limited to 'app/graphql/mutations/snippets/create.rb')
-rw-r--r-- | app/graphql/mutations/snippets/create.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb index a068fd806f5..a8aeb15afcd 100644 --- a/app/graphql/mutations/snippets/create.rb +++ b/app/graphql/mutations/snippets/create.rb @@ -16,14 +16,6 @@ module Mutations required: true, description: 'Title of the snippet' - argument :file_name, GraphQL::STRING_TYPE, - required: false, - description: 'File name of the snippet' - - argument :content, GraphQL::STRING_TYPE, - required: false, - description: 'Content of the snippet' - argument :description, GraphQL::STRING_TYPE, required: false, description: 'Description of the snippet' @@ -59,6 +51,11 @@ module Mutations snippet = service_response.payload[:snippet] + # Only when the user is not an api user and the operation was successful + if !api_user? && service_response.success? + ::Gitlab::UsageDataCounters::EditorUniqueCounter.track_snippet_editor_edit_action(author: current_user) + end + { snippet: service_response.success? ? snippet : nil, errors: errors_on_object(snippet) |