fix(medusa, types): fix promotion HTTP types in cart (#11304)

This commit is contained in:
Shahed Nasser
2025-02-05 12:31:24 +02:00
committed by GitHub
parent d348204fe5
commit 9f1a3b2a42
4 changed files with 61 additions and 6 deletions
@@ -2,14 +2,10 @@ import { updateCartPromotionsWorkflow } from "@medusajs/core-flows"
import { PromotionActions } from "@medusajs/framework/utils"
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
import { refetchCart } from "../../helpers"
import {
StoreAddCartPromotionsType,
StoreRemoveCartPromotionsType,
} from "../../validators"
import { HttpTypes } from "@medusajs/framework/types"
export const POST = async (
req: MedusaRequest<StoreAddCartPromotionsType>,
req: MedusaRequest<HttpTypes.StoreCartAddPromotion>,
res: MedusaResponse<HttpTypes.StoreCartResponse>
) => {
const workflow = updateCartPromotionsWorkflow(req.scope)
@@ -33,7 +29,7 @@ export const POST = async (
}
export const DELETE = async (
req: MedusaRequest<StoreRemoveCartPromotionsType>,
req: MedusaRequest<HttpTypes.StoreCartRemovePromotion>,
res: MedusaResponse<{
cart: HttpTypes.StoreCart
}>