Closed rlabrovi closed 11 months ago
I was able to fix this by adding one more property called 'name' to entity and then when saving question resource saving title.en to name property:
const setName = (request, content) => {
const { payload } = request;
const titleEn = payload['title.en'];
if (titleEn) {
payload.name = titleEn;
}
return request;
};
actions: {
new: {
before: setName,
},
edit: {
before: setName,
},
},
Contact Details
my github account
What happened?
Error: Objects are not valid as a React child (found: object with keys {en, it, fr, de}). If you meant to render a collection of children, use an array instead. See development console for more details...
Bug prevalence
Whenever I try to assign question to quiz
AdminJS dependencies version
"dependencies": { "@adminjs/express": "^5.0.1", "@adminjs/mongoose": "^3.0.1", "@adminjs/nestjs": "^5.1.0", "@adminjs/upload": "^3.0.1", "@nestjs/common": "9.2.1", "@nestjs/core": "9.2.1", "@nestjs/mongoose": "^9.2.1", "@nestjs/platform-express": "9.2.1", "@nestjs/swagger": "^6.3.0", "@nestjs/terminus": "^10.1.1", "adminjs": "^6.7.5", "class-transformer": "0.5.1", "class-validator": "^0.14.0", "dotenv": "^16.3.1", "express-formidable": "^1.2.0", "express-session": "^1.17.3", "mongoose": "^6.8.3", "reflect-metadata": "0.1.13", "rxjs": "7.5.5" }, "devDependencies": { "@nestjs/cli": "^9.5.0", "@nestjs/config": "^3.1.1", "@nestjs/schematics": "9.0.4", "@trivago/prettier-plugin-sort-imports": "^4.2.1", "@types/express": "4.17.13", "@types/node": "18.0.0", "@types/supertest": "2.0.12", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "8.18.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "prettier": "^2.8.8", "source-map-support": "^0.5.20", "supertest": "6.2.3", "ts-loader": "9.3.0", "ts-node": "10.8.1", "tsconfig-paths": "3.14.1", "typescript": "4.7.4" },
What browsers do you see the problem on?
No response
Relevant log output
No response
Relevant code that's giving you issues
No response