adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

TypeError: this.model.getRepository is not a function on Many To Many relations

Open andresogando opened this issue 3 years ago • 0 comments

Describe the bug When a Many To Many relation is declared with @JoinTable decorator app crash with this error TypeError: this.model.getRepository is not a function

Installed libraries and their versions

"@adminjs/express": "^5.0.1", "@adminjs/typeorm": "^4.0.0", "@types/cookie-parser": "^1.4.3", "adminjs": "^6.5.0", "typeorm": "^0.3.7",

To Reproduce Steps to reproduce the behavior: declare one property like this:

@ManyToMany(() => Review, {
    nullable: true,
    cascade: true,
  })
  @JoinTable()
  user_reviews_reviewer: Review[] | Nullish;

andresogando avatar Dec 06 '22 16:12 andresogando