fix: Refactor attachment downloads during export to use promises (#5294

* Refactor attachment downloads during export to use promises instead of streams
Date attachments in zip file correctly

* tsc
This commit is contained in:
Tom Moor
2023-05-04 20:20:33 -04:00
committed by GitHub
parent d096ba486f
commit 9942bbee3e
6 changed files with 50 additions and 28 deletions

View File

@@ -13,7 +13,7 @@ import {
FileOperationState,
FileOperationType,
} from "@shared/types";
import { deleteFromS3, getFileByKey } from "@server/utils/s3";
import { deleteFromS3, getFileStream } from "@server/utils/s3";
import Collection from "./Collection";
import Team from "./Team";
import User from "./User";
@@ -77,7 +77,7 @@ class FileOperation extends IdModel {
* The file operation contents as a readable stream.
*/
get stream() {
return getFileByKey(this.key);
return getFileStream(this.key);
}
// hooks