feat(medusa): Get route for admin product categories API (#2961)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user