diff options
Diffstat (limited to 'app/graphql/mutations/snippets/update.rb')
-rw-r--r-- | app/graphql/mutations/snippets/update.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/app/graphql/mutations/snippets/update.rb b/app/graphql/mutations/snippets/update.rb index 6ff632ec008..d0db5fa2eb9 100644 --- a/app/graphql/mutations/snippets/update.rb +++ b/app/graphql/mutations/snippets/update.rb @@ -14,14 +14,6 @@ module Mutations required: false, 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' @@ -42,6 +34,11 @@ module Mutations update_params(args)).execute(snippet) snippet = result.payload[:snippet] + # Only when the user is not an api user and the operation was successful + if !api_user? && result.success? + ::Gitlab::UsageDataCounters::EditorUniqueCounter.track_snippet_editor_edit_action(author: current_user) + end + { snippet: result.success? ? snippet : snippet.reset, errors: errors_on_object(snippet) |