You need to provide some classes and decorators yourself to maintain the same style as typeorm@2.x
.
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}
↓
@CustomRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}
@Module({
exports: [UserService],
imports: [TypeOrmModule.forFeature([UserRepository])],
providers: [UserService],
})
export class UserModule {}
↓
@Module({
exports: [UserService],
imports: [TypeOrmExModule.forCustomRepository([UserRepository])],
providers: [UserService],
})
export class UserModule {}
Hi, thanks for your great workaround.
I'm new in nestJs. The thing is now I can't use this service inside another module.
I have a
UsersModule
that uses custom repository and exportsUsersService
. In myAuthModule
I have importedUsersModule
and inAuthService
I'm trying to useUsersService
. I'm facing the error bellow:any help would be appreciated.