expire download links

This commit is contained in:
Pete Matsyburka
2025-08-31 16:40:18 +03:00
parent 02c7cdcd97
commit c4a693846e
26 changed files with 184 additions and 78 deletions
@@ -34,10 +34,12 @@ module Api
associations: [:blob]
).call
expires_at = Accounts.link_expires_at(current_account)
render json: {
id: @submission.id,
documents: documents.map do |attachment|
{ name: attachment.filename.base, url: ActiveStorage::Blob.proxy_url(attachment.blob) }
{ name: attachment.filename.base, url: ActiveStorage::Blob.proxy_url(attachment.blob, expires_at:) }
end
}
end