We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aaba280 commit 71db7d0Copy full SHA for 71db7d0
1 file changed
packages/medusa/src/services/order.ts
@@ -534,12 +534,14 @@ class OrderService extends TransactionBaseService {
534
const cartServiceTx = this.cartService_.withTransaction(manager)
535
const inventoryServiceTx = this.inventoryService_.withTransaction(manager)
536
537
- const exists = !!(await this.retrieveByCartId(
538
- isString(cartOrId) ? cartOrId : cartOrId?.id,
539
- {
540
- select: ["id"],
541
- }
542
- ))
+ const exists = !!(
+ await this.list(
+ { cart_id: isString(cartOrId) ? cartOrId : cartOrId?.id },
+ {
+ select: ["id"],
+ }
543
+ )
544
+ ).length
545
546
if (exists) {
547
throw new MedusaError(
0 commit comments