feat(medusa): Get route for admin product categories API (#2961)

This commit is contained in:
Riqwan Thamir
2023-01-10 10:08:16 +01:00
committed by GitHub
parent 33b3e5f16d
commit 47d075351f
13 changed files with 393 additions and 2 deletions
+1
View File
@@ -22,3 +22,4 @@ export * from "./simple-payment-collection-factory"
export * from "./simple-order-edit-factory"
export * from "./simple-order-item-change-factory"
export * from "./simple-customer-factory"
export * from "./simple-product-category-factory"
@@ -0,0 +1,12 @@
import { Connection } from "typeorm"
import { ProductCategory } from "@medusajs/medusa"
export const simpleProductCategoryFactory = async (
connection: Connection,
data: Partial<ProductCategory> = {}
): Promise<ProductCategory> => {
const manager = connection.manager
const address = manager.create(ProductCategory, data)
return await manager.save(address)
}