fix: Refactor collection exports to not send email attachment (#2460)

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Saumya Pandey
2021-08-29 02:57:07 +05:30
committed by GitHub
parent 28aef82af9
commit 00ba65f3ef
38 changed files with 1252 additions and 167 deletions

View File

@ -1,7 +1,7 @@
// @flow
import { Attachment, Document } from "../models";
import parseAttachmentIds from "../utils/parseAttachmentIds";
import { getSignedImageUrl } from "../utils/s3";
import { getSignedUrl } from "../utils/s3";
import presentUser from "./user";
type Options = {
@ -16,7 +16,7 @@ async function replaceImageAttachments(text: string) {
attachmentIds.map(async (id) => {
const attachment = await Attachment.findByPk(id);
if (attachment) {
const accessUrl = await getSignedImageUrl(attachment.key);
const accessUrl = await getSignedUrl(attachment.key);
text = text.replace(attachment.redirectUrl, accessUrl);
}
})