@wrcb/cb-common 1.0.458 → 1.0.459

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.
@@ -53,6 +53,16 @@ exports.uploadMedia = {
53
53
  }
54
54
  if (!allFiles.length)
55
55
  return next();
56
+ if (req.files && !Array.isArray(req.files)) {
57
+ const imageFiles = req.files['images'] || [];
58
+ if (imageFiles.length > 5) {
59
+ throw new badRequestError_1.BadRequestError('TooManyImages');
60
+ }
61
+ const videoFiles = req.files['videos'] || [];
62
+ if (videoFiles.length > 1) {
63
+ throw new badRequestError_1.BadRequestError('TooManyVideos');
64
+ }
65
+ }
56
66
  // Validação baseada no maxSizeMB por campo
57
67
  const fieldConfig = req._uploadFieldConfig || [];
58
68
  const getMaxSizeForField = (fieldName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.458",
3
+ "version": "1.0.459",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",