Open marinadeotti opened 1 year ago
When using the upload feature with "multiple: true", when I delete an image that has been uploaded and try to save, I get the error:
TypeError: record.get(...).filter is not a function
Apparently the filesToDelete option is not being able to filter the array of images.
filesToDelete
Trying to update an array of images
{ "dependencies": { "@admin-bro/express": "^3.1.0", "@admin-bro/mongoose": "^1.1.0", "@admin-bro/upload": "^1.3.1", "@adminjs/upload": "^3.0.0", "@aws-sdk/client-s3": "^3.321.1", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", "add": "^2.0.6", "admin-bro": "^4.0.1", "assert": "^2.0.0", "aws-sdk": "^2.1365.0", "bcrypt": "^5.1.0", "browserslist": "^4.21.4", "buffer": "^6.0.3", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.1", "express-formidable": "^1.2.0", "express-session": "^1.17.3", "fs": "^0.0.1-security", "koa": "^2.13.4", "koa-mount": "^4.0.0", "koa-static": "^5.0.0", "material-ui-dropzone": "^3.5.0", "mongoose": "^7.0.5", "mongoose-slug-generator": "^1.0.4", "os": "^0.1.2", "path": "^0.12.7", "prop-types": "^15.8.1", "react-dropzone": "^14.2.3", "rollup-plugin-includepaths": "^0.2.4", "safe-buffer": "^5.2.1", "slugify": "^1.6.5", "tinymce": "^6.3.1", "tslib": "^2.4.0", "url": "^0.11.0", "util": "^0.12.4", "uuid": "^9.0.0" }, "scripts": { "dev": "nodemon admin.js", "start": "node admin.js" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.2", "@rollup/plugin-node-resolve": "^14.1.0", "nodemon": "^2.0.22", "rollup-plugin-polyfill-node": "^0.12.0" } }
Chrome
TypeError: Cannot read properties of undefined (reading '0')
features: [ uploadFeature({ provider: { aws: { KEYS GO HERE }, }, properties: { file: "Imagens", filePath: "image.path", filesToDelete: "image.filesToDelete", key: "imageUrl", mimeType: "imageMimeType", }, validation: imageValidation, multiple: true }), ],
What happened?
When using the upload feature with "multiple: true", when I delete an image that has been uploaded and try to save, I get the error:
TypeError: record.get(...).filter is not a function
Apparently the
filesToDelete
option is not being able to filter the array of images.Bug prevalence
Trying to update an array of images
AdminJS dependencies version
{ "dependencies": { "@admin-bro/express": "^3.1.0", "@admin-bro/mongoose": "^1.1.0", "@admin-bro/upload": "^1.3.1", "@adminjs/upload": "^3.0.0", "@aws-sdk/client-s3": "^3.321.1", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", "add": "^2.0.6", "admin-bro": "^4.0.1", "assert": "^2.0.0", "aws-sdk": "^2.1365.0", "bcrypt": "^5.1.0", "browserslist": "^4.21.4", "buffer": "^6.0.3", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.1", "express-formidable": "^1.2.0", "express-session": "^1.17.3", "fs": "^0.0.1-security", "koa": "^2.13.4", "koa-mount": "^4.0.0", "koa-static": "^5.0.0", "material-ui-dropzone": "^3.5.0", "mongoose": "^7.0.5", "mongoose-slug-generator": "^1.0.4", "os": "^0.1.2", "path": "^0.12.7", "prop-types": "^15.8.1", "react-dropzone": "^14.2.3", "rollup-plugin-includepaths": "^0.2.4", "safe-buffer": "^5.2.1", "slugify": "^1.6.5", "tinymce": "^6.3.1", "tslib": "^2.4.0", "url": "^0.11.0", "util": "^0.12.4", "uuid": "^9.0.0" }, "scripts": { "dev": "nodemon admin.js", "start": "node admin.js" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.2", "@rollup/plugin-node-resolve": "^14.1.0", "nodemon": "^2.0.22", "rollup-plugin-polyfill-node": "^0.12.0" } }
What browsers do you see the problem on?
Chrome
Relevant log output
Relevant code that's giving you issues