fix(dashboard): updated variant title is used when creating product (#10155)

This commit is contained in:
Riqwan Thamir
2024-11-19 16:22:34 +01:00
committed by GitHub
parent a1738f823c
commit 2783bed8ae
2 changed files with 1 additions and 3 deletions
@@ -25,7 +25,6 @@ const ProductCreateVariantSchema = z.object({
weight: optionalInt, weight: optionalInt,
material: z.string().optional(), material: z.string().optional(),
origin_country: z.string().optional(), origin_country: z.string().optional(),
custom_title: z.string().optional(),
sku: z.string().optional(), sku: z.string().optional(),
manage_inventory: z.boolean().optional(), manage_inventory: z.boolean().optional(),
allow_backorder: z.boolean().optional(), allow_backorder: z.boolean().optional(),
@@ -53,8 +53,7 @@ export const normalizeVariants = (
regionsCurrencyMap: Record<string, string> regionsCurrencyMap: Record<string, string>
) => { ) => {
return variants.map((variant) => ({ return variants.map((variant) => ({
title: title: variant.title || Object.values(variant.options || {}).join(" / "),
variant.custom_title || Object.values(variant.options || {}).join(" / "),
options: variant.options, options: variant.options,
sku: variant.sku || undefined, sku: variant.sku || undefined,
manage_inventory: !!variant.manage_inventory, manage_inventory: !!variant.manage_inventory,