1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix: add segment to strategy payload (#3611)

This commit is contained in:
Mateusz Kwasniewski 2023-04-25 10:57:53 +02:00 committed by GitHub
parent 8fdb152ec5
commit e538cb8a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -114,9 +114,9 @@ export const FeatureStrategyCreate = () => {
refetchChangeRequests(); refetchChangeRequests();
}; };
const onSubmit = async () => { const payload = createStrategyPayload(strategy, segments);
const payload = createStrategyPayload(strategy, segments);
const onSubmit = async () => {
trackEvent('strategyTitle', { trackEvent('strategyTitle', {
props: { props: {
hasTitle: Boolean(strategy.title), hasTitle: Boolean(strategy.title),
@ -153,7 +153,7 @@ export const FeatureStrategyCreate = () => {
projectId, projectId,
featureId, featureId,
environmentId, environmentId,
strategy, payload,
unleashUrl unleashUrl
) )
} }

View File

@ -94,6 +94,9 @@ export const FeatureStrategyEdit = () => {
savedStrategySegments && setSegments(savedStrategySegments); savedStrategySegments && setSegments(savedStrategySegments);
}, [JSON.stringify(savedStrategySegments)]); }, [JSON.stringify(savedStrategySegments)]);
const segmentsToSubmit = uiConfig?.flags.SE ? segments : [];
const payload = createStrategyPayload(strategy, segmentsToSubmit);
const onStrategyEdit = async (payload: IFeatureStrategyPayload) => { const onStrategyEdit = async (payload: IFeatureStrategyPayload) => {
await updateStrategyOnFeature( await updateStrategyOnFeature(
projectId, projectId,
@ -134,9 +137,6 @@ export const FeatureStrategyEdit = () => {
}; };
const onSubmit = async () => { const onSubmit = async () => {
const segmentsToSubmit = uiConfig?.flags.SE ? segments : [];
const payload = createStrategyPayload(strategy, segmentsToSubmit);
try { try {
if (isChangeRequestConfigured(environmentId)) { if (isChangeRequestConfigured(environmentId)) {
await onStrategyRequestEdit(payload); await onStrategyRequestEdit(payload);
@ -168,7 +168,7 @@ export const FeatureStrategyEdit = () => {
projectId, projectId,
featureId, featureId,
environmentId, environmentId,
strategy, payload,
strategyDefinition, strategyDefinition,
unleashUrl unleashUrl
) )