ERROR: 'EntityRepository' is deprecated , 2024-01-29

sunj - Jan 29 - - Dev Community

'EntityRepository' is deprecated.

typeorm 0.3.x 버전부터는 기존에 사용하던 @EntityRepository가 사용할 수 없게 되었다.

auth.service

@Injectable()
export class AuthService {
    constructor(
        @InjectRepository(UserRepository)
        private UserRepository: UserRepository
    ){}

Enter fullscreen mode Exit fullscreen mode

user.repository

@Injectable()
export class UserRepository extends Repository<User> {
    constructor(dataSource: DataSource) {
        super(User, dataSource.createEntityManager());
    }
Enter fullscreen mode Exit fullscreen mode

auth.module

@Module({
  imports:[
    TypeOrmModule.forFeature([User])
  ],
  controllers: [AuthController],
  providers: [AuthService, UserRepository]
})
export class AuthModule {}
Enter fullscreen mode Exit fullscreen mode

참조 : https://velog.io/@sheoae12/NestJS-Custom-Repository-%EB%A7%8C%EB%93%A4%EA%B8%B0

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player