Skip to content

Commit

Permalink
Merge pull request #55 from cap-js/fixes
Browse files Browse the repository at this point in the history
Fixes in upload
  • Loading branch information
muskansethi1 authored May 30, 2024
2 parents 515870d + 3f0707b commit 6ff0270
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
- Enabled malware scanning in hybrid profile by default.
- Added a 10 sec delay before setting scan status to `Clean` if malware scanning is default.

### Fixed

- Bug fixes for upload functionality in production

## Version 1.1.0

### Added
Expand Down
14 changes: 7 additions & 7 deletions lib/aws-s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
if (attachments) {
const diffData = await req.diff();
let deletedAttachments = [];
diffData.attachments
.filter((object) => {
diffData.attachments?.filter((object) => {
return object._op === "delete";
})
.map((attachment) => {
deletedAttachments.push(attachment.ID);
});
let attachmentsToDelete = await SELECT.from(attachments)
.columns("url")
.where({ ID: { in: [...deletedAttachments] } });
if (attachmentsToDelete.length > 0) {
req.attachmentsToDelete = attachmentsToDelete;

if(deletedAttachments.length > 0) {
let attachmentsToDelete = await SELECT.from(attachments).columns("url").where({ ID: { in: [...deletedAttachments] } });
if (attachmentsToDelete.length > 0) {
req.attachmentsToDelete = attachmentsToDelete;
}
}
}
}
Expand Down

0 comments on commit 6ff0270

Please sign in to comment.