mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 14:26:02 +00:00
Merge pull request #1037 from scomans/main
fix: renaming environments not updated in `secretimports` model
This commit is contained in:
@@ -394,6 +394,11 @@ export const renameWorkspaceEnvironment = async (req: Request, res: Response) =>
|
|||||||
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
{ environment: environmentSlug }
|
{ environment: environmentSlug }
|
||||||
);
|
);
|
||||||
|
await SecretImport.updateMany(
|
||||||
|
{ workspace: workspaceId, 'imports.environment': oldEnvironmentSlug },
|
||||||
|
{ $set: { 'imports.$[element].environment': environmentSlug } },
|
||||||
|
{ arrayFilters: [{ 'element.environment': oldEnvironmentSlug }] },
|
||||||
|
);
|
||||||
|
|
||||||
await ServiceAccountWorkspacePermission.updateMany(
|
await ServiceAccountWorkspacePermission.updateMany(
|
||||||
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
|
|||||||
Reference in New Issue
Block a user