chore: merge money amounts and price set money amounts (#6768)
what: - merges price set money amounts and money amount
This commit is contained in:
@@ -13,14 +13,14 @@ export const adminPriceListRemoteQueryFields = [
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"deleted_at",
|
||||
"price_set_money_amounts.money_amount.id",
|
||||
"price_set_money_amounts.money_amount.currency_code",
|
||||
"price_set_money_amounts.money_amount.amount",
|
||||
"price_set_money_amounts.money_amount.min_quantity",
|
||||
"price_set_money_amounts.money_amount.max_quantity",
|
||||
"price_set_money_amounts.money_amount.created_at",
|
||||
"price_set_money_amounts.money_amount.deleted_at",
|
||||
"price_set_money_amounts.money_amount.updated_at",
|
||||
"price_set_money_amounts.id",
|
||||
"price_set_money_amounts.currency_code",
|
||||
"price_set_money_amounts.amount",
|
||||
"price_set_money_amounts.min_quantity",
|
||||
"price_set_money_amounts.max_quantity",
|
||||
"price_set_money_amounts.created_at",
|
||||
"price_set_money_amounts.deleted_at",
|
||||
"price_set_money_amounts.updated_at",
|
||||
"price_set_money_amounts.price_set.variant.id",
|
||||
"price_set_money_amounts.price_rules.value",
|
||||
"price_set_money_amounts.price_rules.rule_type.rule_attribute",
|
||||
|
||||
@@ -17,7 +17,7 @@ export const remapKeysForProduct = (selectFields: string[]) => {
|
||||
.map((fieldName: string) =>
|
||||
fieldName.replace(
|
||||
"variants.prices.",
|
||||
"variants.price_set.price_set_money_amounts.money_amount."
|
||||
"variants.price_set.price_set_money_amounts."
|
||||
)
|
||||
)
|
||||
|
||||
@@ -31,10 +31,7 @@ export const remapKeysForVariant = (selectFields: string[]) => {
|
||||
const pricingFields = selectFields
|
||||
.filter((fieldName: string) => isPricing(fieldName))
|
||||
.map((fieldName: string) =>
|
||||
fieldName.replace(
|
||||
"prices.",
|
||||
"price_set.price_set_money_amounts.money_amount."
|
||||
)
|
||||
fieldName.replace("prices.", "price_set.price_set_money_amounts.")
|
||||
)
|
||||
|
||||
return [...variantFields, ...pricingFields]
|
||||
@@ -51,7 +48,7 @@ export const remapVariant = (v: ProductVariantDTO) => {
|
||||
return {
|
||||
...v,
|
||||
prices: (v as any).price_set?.price_set_money_amounts?.map((psma) => ({
|
||||
...psma.money_amount,
|
||||
...psma,
|
||||
variant_id: v.id,
|
||||
})),
|
||||
price_set: undefined,
|
||||
|
||||
Reference in New Issue
Block a user