OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Move API code specific to storages into its module
Christophe Bliard8b2c54cf06cc
diff --git a/lib/api/v3/root.rb b/lib/api/v3/root.rbindex 55df0c43608..edff4fe8d84 100644--- a/lib/api/v3/root.rb+++ b/lib/api/v3/root.rb@@ -69,8 +69,6 @@ module APImount ::API::V3::Repositories::RevisionsAPImount ::API::V3::Roles::RolesAPImount ::API::V3::Statuses::StatusesAPI- mount ::API::V3::Storages::StoragesAPI- mount ::API::V3::FileLinks::FileLinksAPImount ::API::V3::StringObjects::StringObjectsAPImount ::API::V3::Types::TypesAPImount ::API::V3::Users::UsersAPIdiff --git a/lib/api/v3/utilities/path_helper.rb b/lib/api/v3/utilities/path_helper.rbindex 982c3132be2..66824436112 100644--- a/lib/api/v3/utilities/path_helper.rb+++ b/lib/api/v3/utilities/path_helper.rb@@ -198,10 +198,6 @@ module API"#{root}/custom_options/#{id}"end- def self.file_links_by_work_package(id)- "#{work_package(id)}/file_links"- end-index :help_textshow :help_textdiff --git a/lib/api/v3/work_packages/work_packages_api.rb b/lib/api/v3/work_packages/work_packages_api.rbindex 46bb2cbc5ce..d0eec10b39d 100644--- a/lib/api/v3/work_packages/work_packages_api.rb+++ b/lib/api/v3/work_packages/work_packages_api.rb@@ -102,7 +102,6 @@ module APImount ::API::V3::WorkPackages::AvailableProjectsOnEditAPImount ::API::V3::WorkPackages::AvailableRelationCandidatesAPImount ::API::V3::WorkPackages::WorkPackageRelationsAPI- mount ::API::V3::FileLinks::WorkPackagesFileLinksAPIendmount ::API::V3::WorkPackages::CreateFormAPIdiff --git a/modules/storages/lib/api/v3/file_links/create_endpoint.rb b/modules/storages/lib/api/v3/file_links/create_endpoint.rbindex 2fc8be9b7db..466bcd116f7 100644--- a/modules/storages/lib/api/v3/file_links/create_endpoint.rb+++ b/modules/storages/lib/api/v3/file_links/create_endpoint.rb@@ -19,7 +19,7 @@ module API::V3::FileLinksdef present_success(request, call)render_representer.create(call.result,- self_link: request.api_v3_paths.file_links_by_work_package(request.work_package.id),+ self_link: request.api_v3_paths.file_links(request.work_package.id),current_user: request.current_user)enddiff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rbindex b4a2358ec95..dbcc89d8942 100644--- a/modules/storages/lib/open_project/storages/engine.rb+++ b/modules/storages/lib/open_project/storages/engine.rb@@ -115,5 +115,15 @@ module OpenProject::Storagesadd_api_path :file_link_open do |file_link_id|"#{root}/file_links/#{file_link_id}/open"end++ # Add api endpoints specific to this module+ add_api_endpoint 'API::V3::Root' do+ mount ::API::V3::Storages::StoragesAPI+ mount ::API::V3::FileLinks::FileLinksAPI+ end++ add_api_endpoint 'API::V3::WorkPackages::WorkPackagesAPI' do+ mount ::API::V3::FileLinks::WorkPackagesFileLinksAPI+ endendend