Commit 8dc91cde authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Minor alignment adjustments / comments / unnecessary code removal

parent d8c746f4
......@@ -19,7 +19,6 @@ Rails.application.routes.draw do
controllers applications: 'oauth/applications',
authorized_applications: 'oauth/authorized_applications',
authorizations: 'oauth/authorizations'
end
scope path: '/-/jira/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do
......
......@@ -5,9 +5,6 @@ module API
allow_access_with_scope :api
prefix :api
NO_SLASH_URL_PART_REGEX = %r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
version %w(v3 v4), using: :path
version 'v3', using: :path do
......@@ -15,8 +12,6 @@ module API
helpers ::API::Helpers::CommonHelpers
mount ::API::V3::AwardEmoji
mount ::API::V3::GithubRepos
mount ::API::V3::Boards
mount ::API::V3::Branches
mount ::API::V3::BroadcastMessages
......@@ -54,6 +49,11 @@ module API
mount ::API::V3::Triggers
mount ::API::V3::Users
mount ::API::V3::Variables
# Although the following endpoints are kept behind V3 namespace, they're not
# deprecated neither should be removed when V3 get removed.
# They're needed as a layer to integrate with Jira development panel.
mount ::API::V3::GithubRepos
end
before { header['X-Frame-Options'] = 'SAMEORIGIN' }
......@@ -95,6 +95,9 @@ module API
helpers ::API::Helpers
helpers ::API::Helpers::CommonHelpers
NO_SLASH_URL_PART_REGEX = %r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
# Keep in alphabetical order
mount ::API::AccessRequests
mount ::API::AwardEmoji
......
......@@ -42,10 +42,6 @@ module API
project = params[:project]
user_project = find_project!("#{namespace}/#{project}")
branches = ::API::Entities::Github::Branch
.represent(user_project.repository.branches.sort_by(&:name), project: user_project)
.as_json
branches = ::Kaminari.paginate_array(user_project.repository.branches.sort_by(&:name))
present paginate(branches),
......@@ -65,9 +61,6 @@ module API
not_found! 'Commit' unless commit
json_commit = ::API::Entities::Github::RepoCommit.represent(commit).as_json
Rails.logger.info("JSON COMMIT: #{json_commit}")
present commit, with: ::API::Entities::Github::RepoCommit
end
end
......
......@@ -64,11 +64,6 @@ module API
end
end
# desc ':org/repos' do
# Rails.logger.info("Requesting /users/#{params[:org]}/repos with params #{params}")
# Rails.logger.info("User: #{current_user.name}")
# end
desc 'Get the SSH keys of a specified user. Available only for admins.' do
success ::API::Entities::SSHKey
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment