taxtank-core 0.30.23 → 0.30.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17387,6 +17387,10 @@ class FileValidator {
17387
17387
  // File max size check
17388
17388
  static fileMaxSize(maxSize = MAX_SIZE) {
17389
17389
  const validatorFn = (file) => {
17390
+ // We don`t need to validate saved files, because when saving the form, the file was valid
17391
+ if (file instanceof AbstractModel) {
17392
+ return null;
17393
+ }
17390
17394
  return file.size > maxSize ? { fileMaxSize: { maxSize } } : null;
17391
17395
  };
17392
17396
  return FileValidator.fileValidation(validatorFn);
@@ -17394,6 +17398,10 @@ class FileValidator {
17394
17398
  // File extension check
17395
17399
  static fileExtensions(allowedExtensions = DOCUMENT_FILE_TYPES.all) {
17396
17400
  const validatorFn = (file) => {
17401
+ // We don`t need to validate saved files, because when saving the form, the file was valid
17402
+ if (file instanceof AbstractModel) {
17403
+ return null;
17404
+ }
17397
17405
  return allowedExtensions.includes(file.type) ? null : { fileExtension: { allowedExtensions: allowedExtensions.join() } };
17398
17406
  };
17399
17407
  return FileValidator.fileValidation(validatorFn);