feat(utils): Introduce promiseAll util (#5543)
This commit is contained in:
committed by
GitHub
parent
e4ce2f4e07
commit
f90ba02087
@@ -4,7 +4,7 @@ import {
|
||||
ModuleJoinerRelationship,
|
||||
} from "@medusajs/types"
|
||||
|
||||
import { isObject, toPascalCase } from "@medusajs/utils"
|
||||
import { isObject, promiseAll, toPascalCase } from "@medusajs/utils"
|
||||
import { MedusaModule } from "./medusa-module"
|
||||
|
||||
export type DeleteEntityInput = {
|
||||
@@ -311,10 +311,10 @@ export class RemoteLink {
|
||||
deletePromises.push(...relatedServicesPromises)
|
||||
}
|
||||
|
||||
await Promise.all(deletePromises)
|
||||
await promiseAll(deletePromises)
|
||||
})
|
||||
|
||||
await Promise.all(servicePromises)
|
||||
await promiseAll(servicePromises)
|
||||
return returnIdsList
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ export class RemoteLink {
|
||||
promises.push(service.create(links))
|
||||
}
|
||||
|
||||
const created = await Promise.all(promises)
|
||||
const created = await promiseAll(promises)
|
||||
return created.flat()
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ export class RemoteLink {
|
||||
promises.push(service.dismiss(links))
|
||||
}
|
||||
|
||||
const created = await Promise.all(promises)
|
||||
const created = await promiseAll(promises)
|
||||
return created.flat()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user