1.[nest-streaming:feat] 음반 기능 CRUD 추가
참조 링크 : https://github.com/node9137/nest-streaming/pull/6
2.[nest-streaming:fix] soundtrack Repository 부분 Error 해결
=> CustomRepository Decorator 로 , Repository 화 해서 , DB Logic을 수행하려 했으나,
계속 Entity 의 Metadata 가 Not Found 되는 오류가 발생해서 삭제하고 , 다시 만들고 db 날리고 다시해도 에러가 떴는데 ,
nestjs/typeorm 에서 제공하는 TypeORM 을 통해서 , 그냥 DI 를 하니 , 작동함
soundtrack.module.ts
CustomTypeOrmModule.forCustomRepository([SoundtrackRepository])
=================================================>
{
provide: 'SOUNDTRACK_REPOSITORY',
useFactory: (dataSource: DataSource) => dataSource.getRepository(SoundtrackEntity),
inject: [DataSource],
},
soundtrack.service.ts
private readonly soundtrackRepository : SoundtrackRepository){}
=================================================>
@Inject('SOUNDTRACK_REPOSITORY')
private readonly soundtrackRepository : SoundtrackRepository){}
위와 같이 해도 동작을 한다.
혹시나 , Custom Repository 구성 할 때 ,
Entity 를 import 하고 , 동작하는 걸 확인해도 Metadata was not found 가 뜬다면 ,
권장 방법대로 TypeormModule 에서 직접 받고 주입 하자.