mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
refactor: delete safeguard api update (#10992)
This commit is contained in:
parent
778328aa98
commit
29de419e20
@ -409,11 +409,13 @@ export const ReleasePlan = ({
|
||||
|
||||
const handleSafeguardDelete = async () => {
|
||||
try {
|
||||
if (safeguards.length === 0) return;
|
||||
await deleteSafeguard({
|
||||
projectId,
|
||||
featureName,
|
||||
environment,
|
||||
planId: id,
|
||||
safeguardId: safeguards[0].id,
|
||||
});
|
||||
setToastData({
|
||||
type: 'success',
|
||||
|
||||
@ -14,6 +14,7 @@ export interface DeleteSafeguardParams {
|
||||
featureName: string;
|
||||
environment: string;
|
||||
planId: string;
|
||||
safeguardId: string;
|
||||
}
|
||||
|
||||
export const useSafeguardsApi = () => {
|
||||
@ -47,9 +48,10 @@ export const useSafeguardsApi = () => {
|
||||
featureName,
|
||||
environment,
|
||||
planId,
|
||||
safeguardId,
|
||||
}: DeleteSafeguardParams): Promise<void> => {
|
||||
const requestId = 'deleteSafeguard';
|
||||
const path = `api/admin/projects/${projectId}/features/${featureName}/environments/${environment}/release-plans/${planId}/safeguards`;
|
||||
const path = `api/admin/projects/${projectId}/features/${featureName}/environments/${environment}/release-plans/${planId}/safeguards/${safeguardId}`;
|
||||
const req = createRequest(
|
||||
path,
|
||||
{
|
||||
|
||||
@ -22,6 +22,7 @@ export interface IReleasePlanTemplate {
|
||||
}
|
||||
|
||||
export interface ISafeguard {
|
||||
id: string;
|
||||
impactMetric: {
|
||||
aggregationMode: MetricQuerySchemaAggregationMode;
|
||||
metricName: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user