nestjs-form-data
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -19,3 +19,3 @@ "use strict"; | ||
defaultMessage(validationArguments) { | ||
return `${validationArguments.property} does not contain file`; | ||
return `Field "${validationArguments.property}" does not contain file`; | ||
}, | ||
@@ -22,0 +22,0 @@ }, |
@@ -39,10 +39,6 @@ "use strict"; | ||
const formReader = new FormReader_1.FormReader(req, config); | ||
try { | ||
req.body = await formReader.handle(); | ||
return next.handle().pipe(operators_1.tap(res => { | ||
if (config.autoDeleteFile) | ||
formReader.deleteFiles(); | ||
})); | ||
} | ||
catch (err) { | ||
return rxjs_1.from(formReader.handle()).pipe(rxjs_1.mergeMap((formReaderResult) => { | ||
req.body = formReaderResult; | ||
return next.handle(); | ||
}), rxjs_1.catchError(err => { | ||
if (config.autoDeleteFile) | ||
@@ -55,3 +51,6 @@ formReader.deleteFiles(); | ||
return rxjs_1.throwError(err); | ||
} | ||
}), operators_1.tap(res => { | ||
if (config.autoDeleteFile) | ||
formReader.deleteFiles(); | ||
})); | ||
} | ||
@@ -58,0 +57,0 @@ }; |
{ | ||
"name": "nestjs-form-data", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "NestJS middleware for handling multipart/form-data, which is primarily used for uploading files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67012
707