Fix API Error before M5
This commit is contained in:
@@ -146,8 +146,17 @@ export function ProductForm({
|
||||
translations: filled,
|
||||
genderTargets: genders,
|
||||
sportTypes: sports,
|
||||
...(skuPrefix.trim() ? { skuPrefix: skuPrefix.trim() } : {}),
|
||||
basePriceAmount: Number.parseInt(basePrice, 10) || 0,
|
||||
// SKU prefix and base price are create-only fields — the inputs are not
|
||||
// even rendered when editing. Sending them anyway would post
|
||||
// `basePriceAmount: 0`, and the API cannot distinguish "the operator
|
||||
// wants zero" from "the form always sends this", so every variant added
|
||||
// by a later edit would be created free.
|
||||
...(product
|
||||
? {}
|
||||
: {
|
||||
...(skuPrefix.trim() ? { skuPrefix: skuPrefix.trim() } : {}),
|
||||
basePriceAmount: Number.parseInt(basePrice, 10) || 0,
|
||||
}),
|
||||
options: options.map((option, index) => ({
|
||||
key: option.key,
|
||||
position: index,
|
||||
|
||||
Reference in New Issue
Block a user