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
refactor: make FileLinks::ParseCreateParamsService rely more on default ParseResourceParamsService implementation
Christophe Bliardf83c50797557
diff --git a/modules/storages/lib/api/v3/file_links/file_link_payload_representer.rb b/modules/storages/lib/api/v3/file_links/file_link_payload_representer.rbindex 246e942d1b5..f70c36edac8 100644--- a/modules/storages/lib/api/v3/file_links/file_link_payload_representer.rb+++ b/modules/storages/lib/api/v3/file_links/file_link_payload_representer.rb@@ -31,6 +31,8 @@ module APImodule FileLinks# PayloadRepresenter mixin will filter out read-only attributes from user# params input.+ #+ # Used by: ParseCreateParamsService, in parent class.class FileLinkPayloadRepresenter < FileLinkRepresenterinclude ::API::Utilities::PayloadRepresenterenddiff --git a/modules/storages/lib/api/v3/file_links/parse_create_params_service.rb b/modules/storages/lib/api/v3/file_links/parse_create_params_service.rbindex 4b87af1dd70..fe1618ad7fb 100644--- a/modules/storages/lib/api/v3/file_links/parse_create_params_service.rb+++ b/modules/storages/lib/api/v3/file_links/parse_create_params_service.rb@@ -32,23 +32,14 @@ module API::V3::FileLinksattr_reader :request_body- def call(request_body)- @request_body = request_body- ServiceResult.new(- success: true,- result: parse_elements- )- end-private- def parse_elements+ def parse_attributes(request_body)+ @request_body = request_bodyassert_valid_elementselements.map do |element|- API::V3::FileLinks::FileLinkRepresenter- .new(Hashie::Mash.new, current_user: current_user)- .from_hash(element)+ super(element)endend