From dbacbd8ae2cfab426dedc6a163fd248680528114 Mon Sep 17 00:00:00 2001 From: Benoit Queyron <72251526+Benoit-MINT@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:08:51 +0200 Subject: [PATCH] ajustement pour PJ attestation --- app/components/attachment/edit_component.rb | 2 +- app/controllers/attachments_controller.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/attachment/edit_component.rb b/app/components/attachment/edit_component.rb index 5ca264507..24ea1535e 100644 --- a/app/components/attachment/edit_component.rb +++ b/app/components/attachment/edit_component.rb @@ -54,7 +54,7 @@ class Attachment::EditComponent < ApplicationComponent end def destroy_attachment_path - attachment_path(dossier_id: champ&.dossier_id, stable_id: champ&.stable_id, row_id: champ&.row_id, auto_attach_url: @auto_attach_url, view_as: @view_as) + attachment_path(dossier_id: champ&.dossier_id, stable_id: champ&.stable_id, row_id: champ&.row_id, auto_attach_url: @auto_attach_url, view_as: @view_as, direct_upload: @direct_upload) end def attachment_input_class diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 17d5515b2..074a102ff 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -43,8 +43,9 @@ class AttachmentsController < ApplicationController def attachment_options { attached_file: @attachment.record.public_send(@attachment.name), - auto_attach_url: params[:auto_attach_url], - view_as: params[:view_as]&.to_sym + view_as: params[:view_as]&.to_sym, + direct_upload: params[:direct_upload] == "true", + auto_attach_url: params[:direct_upload] == "true" ? params[:auto_attach_url] : nil } end end