From 38b107b3364c0f8dfb94c03f893b6539b5595372 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 22 Oct 2021 13:48:06 +0200 Subject: [PATCH] Change the assets URL returned by API to pre-signed url [SCI-6142] --- app/serializers/api/v1/asset_serializer.rb | 2 +- app/serializers/api/v1/report_serializer.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/serializers/api/v1/asset_serializer.rb b/app/serializers/api/v1/asset_serializer.rb index 13edf402d..e6c28a968 100644 --- a/app/serializers/api/v1/asset_serializer.rb +++ b/app/serializers/api/v1/asset_serializer.rb @@ -16,7 +16,7 @@ module Api end def file_url - rails_blob_url(object.file, disposition: 'attachment') if object.file.attached? + object.file.url if object.file.attached? end end end diff --git a/app/serializers/api/v1/report_serializer.rb b/app/serializers/api/v1/report_serializer.rb index 870a05230..971666e76 100644 --- a/app/serializers/api/v1/report_serializer.rb +++ b/app/serializers/api/v1/report_serializer.rb @@ -22,7 +22,7 @@ module Api end def pdf_file_url - rails_blob_path(object.pdf_file, disposition: 'attachment') + object.pdf_file.url if object.pdf_file.attached? end def docx_file_size @@ -30,7 +30,7 @@ module Api end def docx_file_url - rails_blob_path(object.docx_file, disposition: 'attachment') + object.docx_file.url if object.docx_file.attached? end end end