return existing file for already uploaded case
This commit is contained in:
parent
45a2f5056f
commit
e821ee726c
|
@ -68,7 +68,14 @@ export default async function uploader(
|
||||||
addLogLine(
|
addLogLine(
|
||||||
`file already present in the collection , skipped upload for ${fileNameSize}`
|
`file already present in the collection , skipped upload for ${fileNameSize}`
|
||||||
);
|
);
|
||||||
return { fileUploadResult: UPLOAD_RESULT.ALREADY_UPLOADED };
|
const sameCollectionMatchingExistingFile =
|
||||||
|
matchingExistingFiles.find(
|
||||||
|
(f) => f.collectionID === collection.id
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
fileUploadResult: UPLOAD_RESULT.ALREADY_UPLOADED,
|
||||||
|
uploadedFile: sameCollectionMatchingExistingFile,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
addLogLine(
|
addLogLine(
|
||||||
`same file in ${matchingExistingFilesCollectionIDs.length} collection found for ${fileNameSize}`
|
`same file in ${matchingExistingFilesCollectionIDs.length} collection found for ${fileNameSize}`
|
||||||
|
|
Loading…
Reference in a new issue