From afd6fdcdf6cf5d597aacdf31fa6272da10b7c419 Mon Sep 17 00:00:00 2001 From: Alexander Nortung Date: Wed, 28 Aug 2024 11:13:03 +0200 Subject: [PATCH] fix: product category types (#8833) --- packages/core/types/src/http/product-category/common.ts | 3 ++- packages/modules/product/src/models/product-category.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/types/src/http/product-category/common.ts b/packages/core/types/src/http/product-category/common.ts index cd747d8af3..86d0f67f6a 100644 --- a/packages/core/types/src/http/product-category/common.ts +++ b/packages/core/types/src/http/product-category/common.ts @@ -14,6 +14,7 @@ export interface BaseProductCategory { parent_category: BaseProductCategory | null category_children: BaseProductCategory[] products?: BaseProduct[] + metadata?: Record | null created_at: string updated_at: string deleted_at: string | null @@ -21,7 +22,7 @@ export interface BaseProductCategory { export interface BaseProductCategoryListParams extends FindParams, - BaseFilterable { + BaseFilterable { q?: string id?: string | string[] name?: string | string[] diff --git a/packages/modules/product/src/models/product-category.ts b/packages/modules/product/src/models/product-category.ts index a7a993dba8..3736c3dd1f 100644 --- a/packages/modules/product/src/models/product-category.ts +++ b/packages/modules/product/src/models/product-category.ts @@ -113,7 +113,7 @@ class ProductCategory { deleted_at?: Date @Property({ columnType: "jsonb", nullable: true }) - metadata?: Record | null + metadata: Record | null = null @ManyToMany(() => Product, (product) => product.categories) products = new Collection(this)