From b6f405d1af5a86e88e1ea4acd82da657338ffe53 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Thu, 29 Jun 2023 16:40:14 +0300 Subject: [PATCH] fix: default strategy groupId failure (#4120) --- .../FeatureStrategyCreate/FeatureStrategyCreate.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx index d45b4daec8..155690a542 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx @@ -103,9 +103,16 @@ export const FeatureStrategyCreate = () => { if (shouldUseDefaultStrategy) { const strategyTemplate = defaultStrategy || DEFAULT_STRATEGY; if (strategyTemplate.parameters?.groupId === '' && featureId) { - strategyTemplate.parameters.groupId = featureId; + setStrategy({ + ...strategyTemplate, + parameters: { + ...strategyTemplate.parameters, + groupId: featureId, + }, + } as any); + } else { + setStrategy(strategyTemplate as any); } - setStrategy(strategyTemplate as any); } else if (strategyDefinition) { setStrategy(createFeatureStrategy(featureId, strategyDefinition)); }