Skip to content

Commit 2c61d56

Browse files
talissoncostaclaude
andcommitted
fix(frontend): handle Edge API format for multivariate variation overrides
The Edge API returns multivariate_feature_option as an object with a value property ({ value: number }), while the regular API returns it as a plain number. This caused the variation selection to fail to match when editing identity overrides on Edge API. The fix adds a check to handle both formats when finding the matching variation override. Fixes #6582 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9a6c30b commit 2c61d56

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/web/components/mv/VariationOptions.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,14 @@ export const VariationOptions: React.FC<VariationOptionsProps> = ({
110110
i === variationOverrides[0].multivariate_feature_option_index &&
111111
variationOverrides[0]
112112
} else {
113-
override = variationOverrides?.find(
114-
(v) => v.multivariate_feature_option === theValue.id,
115-
)
113+
override = variationOverrides?.find((v) => {
114+
// Handle both Edge API format ({ value: number }) and regular format (number)
115+
const optionId =
116+
typeof v.multivariate_feature_option === 'object'
117+
? v.multivariate_feature_option?.value
118+
: v.multivariate_feature_option
119+
return optionId === theValue.id
120+
})
116121
}
117122
} else {
118123
override = variationOverrides?.find(

0 commit comments

Comments
 (0)