fix(medusa): cart now returns 404 when not found (#13622)

FIXES #10218 
FIXES CORE-739
This commit is contained in:
William Bouchard
2025-09-30 06:49:17 +00:00
committed by GitHub
parent f970e1355a
commit 9d3c71fefd
3 changed files with 26 additions and 5 deletions
@@ -1,6 +1,7 @@
import { MedusaContainer } from "@medusajs/framework/types"
import {
ContainerRegistrationKeys,
MedusaError,
remoteQueryObjectFromString,
} from "@medusajs/framework/utils"
@@ -18,5 +19,12 @@ export const refetchCart = async (
const [cart] = await remoteQuery(queryObject)
if (!cart) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`Cart with id '${id}' not found`
)
}
return cart
}