You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{getConnection,EntityRepository,In,Repository,getRepository,}from'typeorm';import{LikesasLike}from'@likes/likes.entity';import{CommentsasComment}from'@comments/comments.entity';import{ParagraphsasParagraph}from'@paragraphs/paragraphs.entity';import{AbstractPolymorphicRepository}from'typeorm-polymorphic';import{PostsasPost}from'./posts.entity';
@EntityRepository(Post)exportclassPostsRepositoryextendsAbstractPolymorphicRepository<Post>{asyncfindById(id: number): Promise<Post>{constpost=awaitgetRepository(Post).createQueryBuilder('post').leftJoinAndSelect('post.paragraphs','paragraphs').innerJoinAndSelect('paragraphs.comments','comments').leftJoinAndSelect('paragraphs.likes','likes',).where('post.id = :id',{ id }).getOne();returnpost;}}
i want use 'paragraphs.likes' in PostsRepository
but it always return [ExceptionsHandler] Relation with property path likes in entity was not found.
plz help me i want use this
The text was updated successfully, but these errors were encountered:
i want use 'paragraphs.likes' in PostsRepository
but it always return [ExceptionsHandler] Relation with property path likes in entity was not found.
plz help me i want use this
assumption: you need to define the relationship on the Posts end, or define an inverse relationship. I've been trying to figure out related things lately. I'm not 100% sure if this library actually works as intended, I'm looking into seeing if I can PR something or actually misunderstand.
assumption: you need to define the relationship on the Posts end, or define an inverse relationship. I've been trying to figure out related things lately. I'm not 100% sure if this library actually works as intended, I'm looking into seeing if I can PR something or actually misunderstand.
if you find something useful thing
please notice that
thanks for your reply
Paragraphs.entity.ts
likes.entity.ts
posts.entity.ts
posts.repository.ts
i want use 'paragraphs.likes' in PostsRepository
but it always return [ExceptionsHandler] Relation with property path likes in entity was not found.
plz help me i want use this
The text was updated successfully, but these errors were encountered: