Files
medusa-store/packages/pricing/integration-tests/__fixtures__/price/index.ts
Riqwan Thamir 9073d7aba3 feat(core-flows,medusa,types,utils): rename psma to prices (#6796)
What:

Renames pricesetmoneyamount to prices

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-25 13:15:25 +00:00

22 lines
480 B
TypeScript

import { SqlEntityManager } from "@mikro-orm/postgresql"
import { Price } from "@models"
import { defaultPricesData } from "./data"
export * from "./data"
export async function createPrices(
manager: SqlEntityManager,
pricesData: any[] = defaultPricesData
): Promise<Price[]> {
const prices: Price[] = []
for (let data of pricesData) {
const price = manager.create(Price, data)
prices.push(price)
}
await manager.persistAndFlush(prices)
return prices
}