dariomncs / nestjs-mikro-orm

NestJS MikroORM integration
36 stars 6 forks source link

Documentation incorrect #5

Open collabcoding614 opened 4 years ago

collabcoding614 commented 4 years ago

https://mikro-orm.io/docs/usage-with-nestjs

The adapter forFeature is incorrectly documented. The documentation shows

@Module({
  imports: [MikroOrmModule.forFeature([Photo])],
  providers: [PhotoService],
  controllers: [PhotoController],
})
export class PhotoModule {}

When it should be

@Module({
  imports: [MikroOrmModule.forFeature([{entities: Photo}])],
  providers: [PhotoService],
  controllers: [PhotoController],
})
export class PhotoModule {}
dariomncs commented 4 years ago

thank you for reporting! I already fixed it in the https://github.com/dario1985/nestjs-mikro-orm/commit/6536d4d43701236d9e25c46450c6b82c35e7261e

+@B4nan to report the error in the website too.

B4nan commented 4 years ago

What about supporting that array param? Currently there is no other option as the entities array, right? I would support both (to maintain BC).

dariomncs commented 4 years ago

Ok! I don't think I ever supported that, I think It was an error in the README.md but I can add support for both formats easily.