fix(medusa): cart now returns 404 when not found (#13622)
FIXES #10218 FIXES CORE-739
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user