TypeORM save nested objects
I'm working on a express (with TypeORM) + ReactJS app. The problem is that I have 3 entities linked by OneToMany relationship like this: customer product(linked to customer) model(linked to product) import { Product } from './product.entity' @Entity('customer') export class Customer extends BaseEntity{ @PrimaryGeneratedColumn() readonly id: number; @Column ({name: 'name'}) name : string; @Column ({name: 'test', nullable: true}) test : string; @OneToMany(() => Product, product => product.customer) // @JoinColumn({ name: 'product_id' }) products: Product[] } import {Customer} from './customer.en
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.