1.3.5-6 - Prod Build - Add back filename.
This commit is contained in:
@@ -18,12 +18,13 @@ export const handleUpload = async (ev, context) => {
|
||||
const { bodyshop, jobId } = context;
|
||||
|
||||
const imageData = await MediaLibrary.getAssetInfoAsync(mediaId);
|
||||
const newFile = await (await fetch(imageData.uri)).blob();
|
||||
const newFile = await (
|
||||
await fetch(imageData.localUri || imageData.uri)
|
||||
).blob();
|
||||
let extension = imageData.localUri.split(".").pop();
|
||||
let key = `${bodyshop.id}/${jobId}/${newFile.data.name.replace(
|
||||
/\.[^/.]+$/,
|
||||
""
|
||||
)}-${new Date().getTime()}`;
|
||||
let key = `${bodyshop.id}/${jobId}/${(
|
||||
imageData.filename || imageData.uri.split("/").pop()
|
||||
).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`;
|
||||
|
||||
const res = await uploadToCloudinary(
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user