chore: fix interfaces for product module (#5387)
Some changes based on @shahednasser's PR - https://github.com/medusajs/medusa/pull/5341
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { DAL } from "@medusajs/types"
|
||||
import { DALUtils, generateEntityId } from "@medusajs/utils"
|
||||
import {
|
||||
BeforeCreate,
|
||||
@@ -14,7 +15,6 @@ import {
|
||||
} from "@mikro-orm/core"
|
||||
import { Product } from "./index"
|
||||
import ProductOptionValue from "./product-option-value"
|
||||
import { DAL } from "@medusajs/types"
|
||||
|
||||
type OptionalRelations =
|
||||
| "values"
|
||||
@@ -39,8 +39,9 @@ class ProductOption {
|
||||
@ManyToOne(() => Product, {
|
||||
index: "IDX_product_option_product_id",
|
||||
fieldName: "product_id",
|
||||
nullable: true,
|
||||
})
|
||||
product: Product
|
||||
product!: Product
|
||||
|
||||
@OneToMany(() => ProductOptionValue, (value) => value.option, {
|
||||
cascade: [Cascade.REMOVE, "soft-remove" as any],
|
||||
|
||||
Reference in New Issue
Block a user