summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/snippets/create.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-18 15:08:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-18 15:08:15 +0000
commite35f91f05bc00106dda3b9268c462db14c7f8ad6 (patch)
tree1f7f775565d9c8355819a9598f9d0262fb0ff26b /app/graphql/mutations/snippets/create.rb
parent48650fe1bfc1e3d20ec3a5702ef4d64e9fe69912 (diff)
downloadgitlab-ce-e35f91f05bc00106dda3b9268c462db14c7f8ad6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/mutations/snippets/create.rb')
-rw-r--r--app/graphql/mutations/snippets/create.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb
index 266a123de82..6fc223fbee7 100644
--- a/app/graphql/mutations/snippets/create.rb
+++ b/app/graphql/mutations/snippets/create.rb
@@ -36,6 +36,10 @@ module Mutations
required: false,
description: 'The project full path the snippet is associated with'
+ argument :uploaded_files, [GraphQL::STRING_TYPE],
+ required: false,
+ description: 'The paths to files uploaded in the snippet description'
+
def resolve(args)
project_path = args.delete(:project_path)
@@ -45,9 +49,14 @@ module Mutations
raise_resource_not_available_error!
end
+ # We need to rename `uploaded_files` into `files` because
+ # it's the expected key param
+ args[:files] = args.delete(:uploaded_files)
+
service_response = ::Snippets::CreateService.new(project,
context[:current_user],
args).execute
+
snippet = service_response.payload[:snippet]
{