summaryrefslogtreecommitdiff
path: root/lib/api/v3/project_snippets.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-02-06 16:54:30 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-07 12:20:00 +0100
commit626e79b6f5ed18e1d023643d3e4b85dc4f20286c (patch)
treee1579e1f457f25ae2c511d8e812fa2956eef0e01 /lib/api/v3/project_snippets.rb
parent5985b55769303824f0ce64ae293b0498f2edfc1b (diff)
downloadgitlab-ce-626e79b6f5ed18e1d023643d3e4b85dc4f20286c.tar.gz
Split V3 entities into a separate fileapi-remove-snippets-expires-at
Diffstat (limited to 'lib/api/v3/project_snippets.rb')
-rw-r--r--lib/api/v3/project_snippets.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/api/v3/project_snippets.rb b/lib/api/v3/project_snippets.rb
index 920cc92217f..9f95d4395fa 100644
--- a/lib/api/v3/project_snippets.rb
+++ b/lib/api/v3/project_snippets.rb
@@ -24,28 +24,28 @@ module API
end
desc 'Get all project snippets' do
- success Entities::ProjectSnippetV3
+ success ::API::V3::Entities::ProjectSnippet
end
params do
use :pagination
end
get ":id/snippets" do
- present paginate(snippets_for_current_user), with: Entities::ProjectSnippetV3
+ present paginate(snippets_for_current_user), with: ::API::V3::Entities::ProjectSnippet
end
desc 'Get a single project snippet' do
- success Entities::ProjectSnippetV3
+ success ::API::V3::Entities::ProjectSnippet
end
params do
requires :snippet_id, type: Integer, desc: 'The ID of a project snippet'
end
get ":id/snippets/:snippet_id" do
snippet = snippets_for_current_user.find(params[:snippet_id])
- present snippet, with: Entities::ProjectSnippetV3
+ present snippet, with: ::API::V3::Entities::ProjectSnippet
end
desc 'Create a new project snippet' do
- success Entities::ProjectSnippetV3
+ success ::API::V3::Entities::ProjectSnippet
end
params do
requires :title, type: String, desc: 'The title of the snippet'
@@ -65,14 +65,14 @@ module API
snippet = CreateSnippetService.new(user_project, current_user, snippet_params).execute
if snippet.persisted?
- present snippet, with: Entities::ProjectSnippetV3
+ present snippet, with: ::API::V3::Entities::ProjectSnippet
else
render_validation_error!(snippet)
end
end
desc 'Update an existing project snippet' do
- success Entities::ProjectSnippetV3
+ success ::API::V3::Entities::ProjectSnippet
end
params do
requires :snippet_id, type: Integer, desc: 'The ID of a project snippet'
@@ -99,7 +99,7 @@ module API
snippet_params).execute
if snippet.persisted?
- present snippet, with: Entities::ProjectSnippetV3
+ present snippet, with: ::API::V3::Entities::ProjectSnippet
else
render_validation_error!(snippet)
end