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

@ -13,6 +13,7 @@ import {
IntegrationAuthentication,
Integration,
AuthenticationProvider,
FileOperation,
} from "../models";
let count = 1;
@ -255,6 +256,31 @@ export async function buildDocument(overrides: Object = {}) {
});
}
export async function buildFileOperation(overrides: Object = {}) {
if (!overrides.teamId) {
const team = await buildTeam();
overrides.teamId = team.id;
}
if (!overrides.userId) {
const user = await buildAdmin({ teamId: overrides.teamId });
overrides.userId = user.id;
}
if (!overrides.collectionId) {
const collection = await buildCollection(overrides);
overrides.collectionId = collection.id;
}
return FileOperation.create({
state: "creating",
size: 0,
key: "key/to/aws/file.zip",
url: "https://www.urltos3file.com/file.zip",
...overrides,
});
}
export async function buildAttachment(overrides: Object = {}) {
if (!overrides.teamId) {
const team = await buildTeam();