From 626e79b6f5ed18e1d023643d3e4b85dc4f20286c Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Mon, 6 Feb 2017 16:54:30 +0100 Subject: Split V3 entities into a separate file --- lib/api/v3/project_snippets.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/api/v3/project_snippets.rb') 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 -- cgit v1.2.1