mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: strategyId in edit strategy API command endpoint (#3725)
Fixes a small issue where the "API Command" for edit strategy was showing the strategyId as `undefined`: `/api/admin/projects/demo-app/features/demoApp.step1/environments/dev/strategies/undefined'` ![image](https://github.com/Unleash/unleash/assets/14320932/19650a15-5cde-43c3-9d2b-a7e790bea0ac)
This commit is contained in:
parent
72eba37cec
commit
8746cb1f89
@ -31,12 +31,13 @@ test('formatUpdateStrategyApiCode', () => {
|
|||||||
'projectId',
|
'projectId',
|
||||||
'featureId',
|
'featureId',
|
||||||
'environmentId',
|
'environmentId',
|
||||||
|
'strategyId',
|
||||||
strategy,
|
strategy,
|
||||||
strategyDefinition,
|
strategyDefinition,
|
||||||
'unleashUrl'
|
'unleashUrl'
|
||||||
)
|
)
|
||||||
).toMatchInlineSnapshot(`
|
).toMatchInlineSnapshot(`
|
||||||
"curl --location --request PUT 'unleashUrl/api/admin/projects/projectId/features/featureId/environments/environmentId/strategies/a' \\\\
|
"curl --location --request PUT 'unleashUrl/api/admin/projects/projectId/features/featureId/environments/environmentId/strategies/strategyId' \\\\
|
||||||
--header 'Authorization: INSERT_API_KEY' \\\\
|
--header 'Authorization: INSERT_API_KEY' \\\\
|
||||||
--header 'Content-Type: application/json' \\\\
|
--header 'Content-Type: application/json' \\\\
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
|
@ -213,6 +213,7 @@ export const FeatureStrategyEdit = () => {
|
|||||||
projectId,
|
projectId,
|
||||||
featureId,
|
featureId,
|
||||||
environmentId,
|
environmentId,
|
||||||
|
strategyId,
|
||||||
payload,
|
payload,
|
||||||
strategyDefinition,
|
strategyDefinition,
|
||||||
unleashUrl
|
unleashUrl
|
||||||
@ -272,6 +273,7 @@ export const formatUpdateStrategyApiCode = (
|
|||||||
projectId: string,
|
projectId: string,
|
||||||
featureId: string,
|
featureId: string,
|
||||||
environmentId: string,
|
environmentId: string,
|
||||||
|
strategyId: string,
|
||||||
strategy: Partial<IFeatureStrategy>,
|
strategy: Partial<IFeatureStrategy>,
|
||||||
strategyDefinition: IStrategy,
|
strategyDefinition: IStrategy,
|
||||||
unleashUrl?: string
|
unleashUrl?: string
|
||||||
@ -290,7 +292,7 @@ export const formatUpdateStrategyApiCode = (
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const url = `${unleashUrl}/api/admin/projects/${projectId}/features/${featureId}/environments/${environmentId}/strategies/${strategy.id}`;
|
const url = `${unleashUrl}/api/admin/projects/${projectId}/features/${featureId}/environments/${environmentId}/strategies/${strategyId}`;
|
||||||
const payload = JSON.stringify(sortedStrategy, undefined, 2);
|
const payload = JSON.stringify(sortedStrategy, undefined, 2);
|
||||||
|
|
||||||
return `curl --location --request PUT '${url}' \\
|
return `curl --location --request PUT '${url}' \\
|
||||||
|
Loading…
Reference in New Issue
Block a user