Switch file/blob argument types

This commit is contained in:
Sam Becker 2024-06-07 10:19:25 -05:00
parent d04404582b
commit fb452f2473
3 changed files with 5 additions and 5 deletions

View File

@ -33,13 +33,13 @@ export const awsS3PutObjectCommandForKey = (Key: string) =>
new PutObjectCommand({ Bucket: AWS_S3_BUCKET, Key, ACL: 'public-read' });
export const awsS3Put = (
file: File | Blob,
file: Blob,
fileName: string,
): Promise<string> =>
awsS3Client().send(new PutObjectCommand({
Bucket: AWS_S3_BUCKET,
Key: fileName,
Body: file,
Body: new File([file], fileName),
ACL: 'public-read',
}))
.then(() => urlForKey(fileName));

View File

@ -54,13 +54,13 @@ export const cloudflareR2PutObjectCommandForKey = (Key: string) =>
new PutObjectCommand({ Bucket: CLOUDFLARE_R2_BUCKET, Key });
export const cloudflareR2Put = (
file: File | Blob,
file: Blob,
fileName: string,
): Promise<string> =>
cloudflareR2Client().send(new PutObjectCommand({
Bucket: CLOUDFLARE_R2_BUCKET,
Key: fileName,
Body: file,
Body: new File([file], fileName),
}))
.then(() => urlForKey(fileName));

View File

@ -136,7 +136,7 @@ export const uploadPhotoFromClient = async (
: vercelBlobUploadFromClient(file, `${PREFIX_UPLOAD}.${extension}`);
export const putFile = (
file: File | Blob,
file: Blob,
fileName: string,
) => {
switch (CURRENT_STORAGE) {