mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 02:27:37 +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 },
|
||||
{ environment: environmentSlug }
|
||||
);
|
||||
await SecretImport.updateMany(
|
||||
{ workspace: workspaceId, 'imports.environment': oldEnvironmentSlug },
|
||||
{ $set: { 'imports.$[element].environment': environmentSlug } },
|
||||
{ arrayFilters: [{ 'element.environment': oldEnvironmentSlug }] },
|
||||
);
|
||||
|
||||
await ServiceAccountWorkspacePermission.updateMany(
|
||||
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||
|
||||
Reference in New Issue
Block a user