Fix Validate attachment error at PR Meteor files 2.2.1 fixes + attachment view.

Thanks to xet7 !

Fixes #4640
This commit is contained in:
Lauri Ojansivu 2022-08-16 22:27:22 +03:00
parent 2cd8cfc9b9
commit c23f5dc858

View file

@ -192,13 +192,13 @@ if (Meteor.isServer) {
check(fileObjId, String);
check(storageDestination, String);
validateAttachment(fileObjId);
Meteor.defer(() => Meteor.call('validateAttachment', fileObjId));
const fileObj = Attachments.findOne({_id: fileObjId});
if (fileObj) {
console.debug("Validation of uploaded file completed: file " + fileObj.path + " - storage destination " + storageDestination);
moveAttachmentToStorage(fileObjId, storageDestination);
Meteor.defer(() => Meteor.call('moveAttachmentToStorage', fileObjId, storageDestination));
}
},
});