diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/graphql/mutations/snippets/create.rb | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
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) |