Include export format in filename
This commit is contained in:
@@ -19,8 +19,14 @@ type Props = {
|
||||
transaction: Transaction;
|
||||
};
|
||||
|
||||
function getKeyForFileOp(teamId: string, name: string) {
|
||||
return `${Buckets.uploads}/${teamId}/${uuidv4()}/${name}-export.zip`;
|
||||
function getKeyForFileOp(
|
||||
teamId: string,
|
||||
format: FileOperationFormat,
|
||||
name: string
|
||||
) {
|
||||
return `${
|
||||
Buckets.uploads
|
||||
}/${teamId}/${uuidv4()}/${name}-export.${format.replace(/outline-/, "")}.zip`;
|
||||
}
|
||||
|
||||
async function collectionExporter({
|
||||
@@ -33,7 +39,11 @@ async function collectionExporter({
|
||||
transaction,
|
||||
}: Props) {
|
||||
const collectionId = collection?.id;
|
||||
const key = getKeyForFileOp(user.teamId, collection?.name || team.name);
|
||||
const key = getKeyForFileOp(
|
||||
user.teamId,
|
||||
format,
|
||||
collection?.name || team.name
|
||||
);
|
||||
const fileOperation = await FileOperation.create(
|
||||
{
|
||||
type: FileOperationType.Export,
|
||||
|
||||
Reference in New Issue
Block a user