fix: product category types (#8833)

This commit is contained in:
Alexander Nortung
2024-08-28 11:13:03 +02:00
committed by GitHub
parent c72b4847b9
commit afd6fdcdf6
2 changed files with 3 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ export interface BaseProductCategory {
parent_category: BaseProductCategory | null
category_children: BaseProductCategory[]
products?: BaseProduct[]
metadata?: Record<string, unknown> | null
created_at: string
updated_at: string
deleted_at: string | null
@@ -21,7 +22,7 @@ export interface BaseProductCategory {
export interface BaseProductCategoryListParams
extends FindParams,
BaseFilterable<BaseProductCategoryListParams> {
BaseFilterable<BaseProductCategoryListParams> {
q?: string
id?: string | string[]
name?: string | string[]

View File

@@ -113,7 +113,7 @@ class ProductCategory {
deleted_at?: Date
@Property({ columnType: "jsonb", nullable: true })
metadata?: Record<string, unknown> | null
metadata: Record<string, unknown> | null = null
@ManyToMany(() => Product, (product) => product.categories)
products = new Collection<Product>(this)