feat(medusa): Revert pricing service setVariantPrices API (#4130)
This commit is contained in:
committed by
GitHub
parent
c4aae6b976
commit
bf18bd0c8a
@@ -69,9 +69,7 @@ export default async (req, res) => {
|
||||
req.retrieveConfig
|
||||
)
|
||||
|
||||
const [variant] = await pricingService.setVariantPrices([
|
||||
{ variant: rawVariant },
|
||||
])
|
||||
const [variant] = await pricingService.setVariantPrices([rawVariant])
|
||||
|
||||
res.status(200).json({ variant })
|
||||
}
|
||||
|
||||
@@ -147,17 +147,14 @@ export default async (req, res) => {
|
||||
currencyCode = region.currency_code
|
||||
}
|
||||
|
||||
let variants = await pricingService.setVariantPrices(
|
||||
rawVariants.map((v) => ({ variant: v })),
|
||||
{
|
||||
cart_id: req.validatedQuery.cart_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
customer_id: req.validatedQuery.customer_id,
|
||||
include_discount_prices: true,
|
||||
ignore_cache: true,
|
||||
}
|
||||
)
|
||||
let variants = await pricingService.setVariantPrices(rawVariants, {
|
||||
cart_id: req.validatedQuery.cart_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
customer_id: req.validatedQuery.customer_id,
|
||||
include_discount_prices: true,
|
||||
ignore_cache: true,
|
||||
})
|
||||
|
||||
const inventoryService: IInventoryService | undefined =
|
||||
req.scope.resolve("inventoryService")
|
||||
|
||||
@@ -97,16 +97,13 @@ export default async (req, res) => {
|
||||
currencyCode = region.currency_code
|
||||
}
|
||||
|
||||
const variantRes = await pricingService.setVariantPrices(
|
||||
[{ variant: rawVariant }],
|
||||
{
|
||||
cart_id: validated.cart_id,
|
||||
customer_id: customer_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
include_discount_prices: true,
|
||||
}
|
||||
)
|
||||
const variantRes = await pricingService.setVariantPrices([rawVariant], {
|
||||
cart_id: validated.cart_id,
|
||||
customer_id: customer_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
include_discount_prices: true,
|
||||
})
|
||||
|
||||
const [variant] = await productVariantInventoryService.setVariantAvailability(
|
||||
variantRes,
|
||||
|
||||
@@ -156,16 +156,13 @@ export default async (req, res) => {
|
||||
currencyCode = region.currency_code
|
||||
}
|
||||
|
||||
const pricedVariants = await pricingService.setVariantPrices(
|
||||
rawVariants.map((v) => ({ variant: v })),
|
||||
{
|
||||
cart_id: validated.cart_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
customer_id: customer_id,
|
||||
include_discount_prices: true,
|
||||
}
|
||||
)
|
||||
const pricedVariants = await pricingService.setVariantPrices(rawVariants, {
|
||||
cart_id: validated.cart_id,
|
||||
region_id: regionId,
|
||||
currency_code: currencyCode,
|
||||
customer_id: customer_id,
|
||||
include_discount_prices: true,
|
||||
})
|
||||
|
||||
const variants = await productVariantInventoryService.setVariantAvailability(
|
||||
pricedVariants,
|
||||
|
||||
Reference in New Issue
Block a user