feat(pricing,medusa,utils): added list + get endpoints for price lists (#6592)

what:

- brings back price list GET endpoints to v2 endpoints
This commit is contained in:
Riqwan Thamir
2024-03-06 23:22:31 +00:00
committed by GitHub
parent 531e9e1e94
commit 000eb61e33
23 changed files with 686 additions and 111 deletions
@@ -1,4 +1,4 @@
import { pick } from "lodash"
import { pickDeep } from "@medusajs/utils"
import { omitDeep } from "./omit-deep"
// TODO: once the legacy totals decoration will be removed.
@@ -52,9 +52,9 @@ function cleanResponseData<T extends unknown | unknown[]>(
fields = [...fieldsSet]
arrayData = arrayData.map((record) =>
pick(omitDeep(record, EXCLUDED_FIELDS), fields)
)
arrayData = arrayData.map((record) => {
return pickDeep(omitDeep(record, EXCLUDED_FIELDS), fields)
})
return (isDataArray ? arrayData : arrayData[0]) as T extends []
? Partial<T>[]