docs: add missing code in create entity doc (#4669)
This commit is contained in:
@@ -71,6 +71,7 @@ import {
|
|||||||
BeforeInsert,
|
BeforeInsert,
|
||||||
Column,
|
Column,
|
||||||
Entity,
|
Entity,
|
||||||
|
JoinColumn,
|
||||||
ManyToOne,
|
ManyToOne,
|
||||||
} from "typeorm"
|
} from "typeorm"
|
||||||
import { BaseEntity } from "@medusajs/medusa"
|
import { BaseEntity } from "@medusajs/medusa"
|
||||||
@@ -86,6 +87,7 @@ export class Post extends BaseEntity {
|
|||||||
author_id: string
|
author_id: string
|
||||||
|
|
||||||
@ManyToOne(() => Author, (author) => author.posts)
|
@ManyToOne(() => Author, (author) => author.posts)
|
||||||
|
@JoinColumn({ name: "author_id" })
|
||||||
author: Author
|
author: Author
|
||||||
|
|
||||||
@BeforeInsert()
|
@BeforeInsert()
|
||||||
|
|||||||
Reference in New Issue
Block a user