Open Samox opened 5 years ago
It should, I don't think the lib is dependent on whether you use forRoot
or forRootAsync
.
It looks like the AdminEntity isn't discovered by TypeORM, could you paste your orm config here? In particular, did you do this:
// If you use an ormconfig.js
const AdminUser = require('nestjs-admin').AdminUserEntity
module.exports = {
/* ... */,
entities: [/* ... */, AdminUser],
// Alternatively:
// entities: [/* ... */, 'node_modules/nestjs-admin/**/*.entity.js'],
}
# If you use environment variables
TYPEORM_ENTITIES=your_existing_paths,node_modules/nestjs-admin/**/*.entity.js
I've followed the docs, I have an ormconfig.json
file so I added to the entities 'node_modules/nestjs-admin/**/*.entity.js'
but then my DataBase is corrupted with the nestjs admin example and test entities.
I've tried to scope better the entities which the typeorm have to had into account using this configuration 'node_modules/nestjs-admin/dist/src/adminUser.entity.js'
and it has worked well.
I hope this helps you @Samox.
@williamdclt shall I create a PR with the docs updated?
@almarto Thanks for reporting! It shouldn't happen, the AdminUser should be the only entity in there. I'll fix it ASAP!
Hello, I'm facing the following issue. Is
TypeOrmModule.forRootAsync
supported ?