feat(medusa, link-modules): sales channel <> order link (#5810)

This commit is contained in:
Frane Polić
2024-01-03 14:07:54 +01:00
committed by GitHub
parent 278b7fb203
commit fe007d01bd
15 changed files with 293 additions and 20 deletions

View File

@@ -38,14 +38,13 @@ export async function detachSalesChannelFromProducts({
if (featureFlagRouter.isFeatureEnabled(MedusaV2Flag.key)) {
const remoteLink = container.resolve("remoteLink")
const promises: Promise<unknown>[] = []
for (const [
salesChannelId,
productIds,
] of salesChannelIdProductIdsMap.entries()) {
productIds.forEach((id) =>
promises.push(
await promiseAll(
productIds.map((id) =>
remoteLink.dismiss({
[Modules.PRODUCT]: {
product_id: id,
@@ -57,8 +56,6 @@ export async function detachSalesChannelFromProducts({
)
)
}
return
} else {
await promiseAll(
Array.from(salesChannelIdProductIdsMap.entries()).map(