chore(core-flows,medusa): order claims (#8271)

This commit is contained in:
Carlos R. L. Rodrigues
2024-07-25 06:33:35 -03:00
committed by GitHub
parent 444a244eab
commit ccfbc0accf
42 changed files with 2416 additions and 84 deletions

View File

@@ -1,4 +1,3 @@
import { OrderTypes } from "@medusajs/types"
import {
createRawPropertiesFromBigNumber,
decorateCartTotals,
@@ -9,13 +8,13 @@ import {
// Reshape the order object to match the OrderDTO
// This function is used to format the order object before returning to the main module methods
export function formatOrder(
export function formatOrder<T = any>(
order,
options: {
entity: any
includeTotals?: boolean
}
): Partial<OrderTypes.OrderDTO> | Partial<OrderTypes.OrderDTO>[] {
): T {
const isArray = Array.isArray(order)
const orders = [...(isArray ? order : [order])]