1
0
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:
Mateusz Kwasniewski 2025-11-17 15:53:34 +01:00 committed by GitHub
parent 778328aa98
commit 29de419e20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

@ -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',

View File

@ -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,
{

View File

@ -22,6 +22,7 @@ export interface IReleasePlanTemplate {
}
export interface ISafeguard {
id: string;
impactMetric: {
aggregationMode: MetricQuerySchemaAggregationMode;
metricName: string;