Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

change frontend to send overwrite value from the modal

adilson403adb3526b7
diff --git a/frontend/src/hooks/api/secretRotationsV2/mutations.tsx b/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
index 2cbcc3e7e7..491eb8703f 100644
--- a/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
+++ b/frontend/src/hooks/api/secretRotationsV2/mutations.tsx
@@ -100,11 +100,12 @@ export const useMoveSecretRotation = () => {
type,
rotationId,
destinationEnvironment,
- destinationSecretPath
+ destinationSecretPath,
+ overwriteDestination
}: TMoveSecretRotationV2DTO) => {
const { data } = await apiRequest.post<TSecretRotationV2Response>(
`/api/v2/secret-rotations/${type}/${rotationId}/move`,
- { destinationEnvironment, destinationSecretPath }
+ { destinationEnvironment, destinationSecretPath, overwriteDestination }
);
return data.secretRotation;
diff --git a/frontend/src/hooks/api/secretRotationsV2/types/index.ts b/frontend/src/hooks/api/secretRotationsV2/types/index.ts
index 004a33a4fc..dc4807a439 100644
--- a/frontend/src/hooks/api/secretRotationsV2/types/index.ts
+++ b/frontend/src/hooks/api/secretRotationsV2/types/index.ts
@@ -195,6 +195,7 @@ export type TMoveSecretRotationV2DTO = {
rotationId: string;
destinationEnvironment: string;
destinationSecretPath: string;
+ overwriteDestination: boolean;
// required for query invalidation
projectId: string;
secretPath: string;
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
index 14aee5b2c8..fd99aef520 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
@@ -284,6 +284,7 @@ const SingleEnvContent = ({
rotationId: rotation.id,
destinationEnvironment: data.environment,
destinationSecretPath: selectedPath.secretPath,
+ overwriteDestination: data.shouldOverwrite,
projectId,
secretPath: sourceSecretPath
});
@@ -632,6 +633,7 @@ const MultiEnvContent = ({
rotationId: rotation.id,
destinationEnvironment: environment.slug,
destinationSecretPath: selectedPath.secretPath,
+ overwriteDestination: data.shouldOverwrite,
projectId,
secretPath: sourceSecretPath
});