Skip to content

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

fix: add project slug param for moving secrets on dashboard overview and environment view

Scott Wilson64cd858f9cf0
diff --git a/frontend/src/hooks/api/secrets/mutations.tsx b/frontend/src/hooks/api/secrets/mutations.tsx
index de960cd04f..5c1986b211 100644
--- a/frontend/src/hooks/api/secrets/mutations.tsx
+++ b/frontend/src/hooks/api/secrets/mutations.tsx
@@ -337,7 +337,7 @@ export const useMoveSecrets = ({
destinationSecretPath,
secretIds,
shouldOverwrite,
- projectId
+ projectSlug
}) => {
const { data } = await apiRequest.post<{
isSourceUpdated: boolean;
@@ -349,7 +349,7 @@ export const useMoveSecrets = ({
destinationSecretPath,
secretIds,
shouldOverwrite,
- projectId
+ projectSlug
});
return data;
diff --git a/frontend/src/hooks/api/secrets/types.ts b/frontend/src/hooks/api/secrets/types.ts
index 327d3659dc..4b45d2d6af 100644
--- a/frontend/src/hooks/api/secrets/types.ts
+++ b/frontend/src/hooks/api/secrets/types.ts
@@ -228,6 +228,7 @@ export type TDeleteSecretBatchDTO = {
export type TMoveSecretsDTO = {
projectId: string;
+ projectSlug: string;
sourceEnvironment: string;
sourceSecretPath: string;
destinationEnvironment: 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 30ea57957b..30d7bf6766 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
@@ -66,6 +66,7 @@ const Content = ({
secrets,
environments,
projectId,
+ projectSlug,
sourceSecretPath
}: ContentProps) => {
const [search, setSearch] = useState(sourceSecretPath);
@@ -194,6 +195,7 @@ const Content = ({
destinationEnvironment: environment.slug,
destinationSecretPath: value.secretPath,
projectId,
+ projectSlug,
secretIds: secretsToMove.map((sec) => sec.id)
});
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
index 226230c1aa..2097fc650c 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
@@ -72,10 +72,7 @@ import {
useMoveSecrets,
useUpdateSecretBatch
} from "@app/hooks/api";
-import {
- dashboardKeys,
- fetchDashboardProjectSecretsByKeys
-} from "@app/hooks/api/dashboard/queries";
+import { dashboardKeys, fetchDashboardProjectSecretsByKeys } from "@app/hooks/api/dashboard/queries";
import { UsedBySecretSyncs } from "@app/hooks/api/dashboard/types";
import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";
import { PendingAction } from "@app/hooks/api/secretFolders/types";
@@ -349,6 +346,7 @@ export const ActionBar = ({
destinationEnvironment,
destinationSecretPath,
projectId,
+ projectSlug: currentProject.slug,
secretIds: secretsToMove.map((sec) => sec.id)
});