Skip to content

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

Use attachment upload representer

Oliver Güntherf026330d19ff
diff --git a/lib/api/v3/attachments/attachment_upload_representer.rb b/lib/api/v3/attachments/attachment_upload_representer.rb
index 3cbe0742d7e..01bdf1e0655 100644
--- a/lib/api/v3/attachments/attachment_upload_representer.rb
+++ b/lib/api/v3/attachments/attachment_upload_representer.rb
@@ -69,7 +69,7 @@ module API
attr_reader :form_url, :form_fields, :attachment
- def initialize(attachment, current_user:)
+ def initialize(attachment, current_user:, embed_links: false)
super
fog_hash = DirectFogUploader.direct_fog_hash attachment: attachment
diff --git a/lib/api/v3/attachments/attachments_by_container_api.rb b/lib/api/v3/attachments/attachments_by_container_api.rb
index 78b93858b24..69ae7908d91 100644
--- a/lib/api/v3/attachments/attachments_by_container_api.rb
+++ b/lib/api/v3/attachments/attachments_by_container_api.rb
@@ -94,6 +94,7 @@ module API
instance_exec &::API::V3::Utilities::Endpoints::Create
.new(model: ::Attachment,
parse_representer: AttachmentParsingRepresenter,
+ render_representer: AttachmentUploadRepresenter,
process_service: ::Attachments::PrepareUploadService,
process_contract: ::Attachments::PrepareUploadContract,
params_getter: method(:parse_multipart),