From 85322819047a22906d5c14f1b89b25a5f13d31bd Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 14 Nov 2023 11:03:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/create.json.jbuilder | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/attachments/create.json.jbuilder b/app/views/attachments/create.json.jbuilder index 3c0ef3559..6ddc5ced2 100644 --- a/app/views/attachments/create.json.jbuilder +++ b/app/views/attachments/create.json.jbuilder @@ -1,2 +1,7 @@ json.id @attachment.id -json.filesize @attachment.filesize +json.title @attachment.title +json.filesize number_to_human_size(@attachment.filesize) +json.is_pdf @attachment.is_pdf? +json.url Rails.application.config_for(:configuration)['platform_url'] + (@attachment.is_pdf? ? download_url(@attachment,disposition:"inline") : download_url(@attachment)).to_s +json.created_on @attachment.created_on.strftime("%Y-%m-%d %H:%M") +json.content_type @attachment.content_type