feat: Categories retrieve + list API (#7009)

This commit is contained in:
Oli Juhl
2024-04-08 19:26:34 +02:00
committed by GitHub
parent db2f0ef53f
commit 6cc9a5e469
41 changed files with 1176 additions and 35 deletions
+1 -1
View File
@@ -2,9 +2,9 @@ import { RepositoryTransformOptions } from "../common"
import { Context } from "../shared-context"
import {
BaseFilterable,
FilterQuery as InternalFilterQuery,
FilterQuery,
FindOptions,
FilterQuery as InternalFilterQuery,
UpsertWithReplaceConfig,
} from "./index"
+1
View File
@@ -5,3 +5,4 @@ export * from "./pricing"
export * from "./sales-channel"
export * from "./stock-locations"
export * from "./tax"
export * from "./product-category"
@@ -0,0 +1 @@
export * from "./product-category"
@@ -0,0 +1,34 @@
import { PaginatedResponse } from "../../../common"
/**
* @experimental
*/
interface ProductCategoryResponse {
id: string
name: string
description: string | null
handle: string | null
is_active: boolean
is_internal: boolean
rank: number | null
parent_category_id: string | null
created_at: string | Date
updated_at: string | Date
parent_category: ProductCategoryResponse
category_children: ProductCategoryResponse[]
}
/**
* @experimental
*/
export interface AdminProductCategoryResponse {
product_category: ProductCategoryResponse
}
/**
* @experimental
*/
export interface AdminProductCategoryListResponse extends PaginatedResponse {
product_categories: ProductCategoryResponse[]
}
@@ -0,0 +1 @@
export * from "./admin"
+4
View File
@@ -900,6 +900,10 @@ export interface FilterableProductCategoryProps
* Whether to include parents of retrieved product categories.
*/
include_ancestors_tree?: boolean
/**
* Filter product categories based on searchable fields
*/
q?: string
}
/**