Skip to content

Commit

Permalink
fix: add segment to strategy payload (#3611)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Apr 25, 2023
1 parent 8fdb152 commit e538cb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export const FeatureStrategyCreate = () => {
refetchChangeRequests();
};

const onSubmit = async () => {
const payload = createStrategyPayload(strategy, segments);
const payload = createStrategyPayload(strategy, segments);

const onSubmit = async () => {
trackEvent('strategyTitle', {
props: {
hasTitle: Boolean(strategy.title),
Expand Down Expand Up @@ -153,7 +153,7 @@ export const FeatureStrategyCreate = () => {
projectId,
featureId,
environmentId,
strategy,
payload,
unleashUrl
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export const FeatureStrategyEdit = () => {
savedStrategySegments && setSegments(savedStrategySegments);
}, [JSON.stringify(savedStrategySegments)]);

const segmentsToSubmit = uiConfig?.flags.SE ? segments : [];
const payload = createStrategyPayload(strategy, segmentsToSubmit);

const onStrategyEdit = async (payload: IFeatureStrategyPayload) => {
await updateStrategyOnFeature(
projectId,
Expand Down Expand Up @@ -134,9 +137,6 @@ export const FeatureStrategyEdit = () => {
};

const onSubmit = async () => {
const segmentsToSubmit = uiConfig?.flags.SE ? segments : [];
const payload = createStrategyPayload(strategy, segmentsToSubmit);

try {
if (isChangeRequestConfigured(environmentId)) {
await onStrategyRequestEdit(payload);
Expand Down Expand Up @@ -168,7 +168,7 @@ export const FeatureStrategyEdit = () => {
projectId,
featureId,
environmentId,
strategy,
payload,
strategyDefinition,
unleashUrl
)
Expand Down

0 comments on commit e538cb8

Please sign in to comment.