Open Chambu311 opened 1 year ago
customerId
and surveyId
have to be defined with @Column
decorator as regular columns. To your @ManyToOne
relations add an additional @JoinColumn({ name: 'surveyId' })
decorator.
thank you that worked
In my case I need to use the 'Relation':
@ManyToOne(() => Entity, (entity) => entity.property, { eager: true })
@JoinColumn({ name: "entity_id", referencedColumnName: "id" })
entity: Relation<Entity>;
@Column("text", { name: "entity_id", nullable: true})
entity_id: string;
then it work to find, show, filter and edit the property 'entity_id'
Contact Details
achambu@gmail.com
What happened?
I want to display my database in the Admin Js Panel, but the the Foreign Key columns dont display any data unless i set the eager option to true in the entity. Doing so also crashes the backend because the eager option brings a huge amount of data. The docs say that specifying a RelationId in the entity is all it takes to fetch the ids of the other tables but that doesnt work. Also the filter option by foreign key doesnt work. It always takes the key as a 0.
Bug prevalence
When i want to display tables in Admin Panel
AdminJS dependencies version
"@adminjs/express": "^5.1.0", "@adminjs/nestjs": "^5.1.0", "@adminjs/typeorm": "^4.0.0", "typeorm": "^0.3.11",
What browsers do you see the problem on?
No response
Relevant log output
Relevant code that's giving you issues