fix: Refactor collection exports to not send email attachment (#2460)
Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user