mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 01:28:13 +00:00
fix: add renamed fields to other models
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import {
|
import {
|
||||||
|
Folder,
|
||||||
Integration,
|
Integration,
|
||||||
Membership,
|
Membership,
|
||||||
Secret,
|
Secret,
|
||||||
@@ -21,9 +22,12 @@ import {
|
|||||||
getUserProjectPermissions
|
getUserProjectPermissions
|
||||||
} from "../../ee/services/ProjectRoleService";
|
} from "../../ee/services/ProjectRoleService";
|
||||||
import { ForbiddenError } from "@casl/ability";
|
import { ForbiddenError } from "@casl/ability";
|
||||||
|
import { SecretImport } from "../../models";
|
||||||
|
import { ServiceAccountWorkspacePermission } from "../../models";
|
||||||
|
import { Webhook } from "../../models";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new workspace environment named [environmentName]
|
* Create new workspace environment named [environmentName]
|
||||||
* with slug [environmentSlug] under workspace with id
|
* with slug [environmentSlug] under workspace with id
|
||||||
* @param req
|
* @param req
|
||||||
* @param res
|
* @param res
|
||||||
@@ -376,6 +380,27 @@ export const renameWorkspaceEnvironment = async (req: Request, res: Response) =>
|
|||||||
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
{ environment: environmentSlug }
|
{ environment: environmentSlug }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await Folder.updateMany(
|
||||||
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
|
{ environment: environmentSlug }
|
||||||
|
);
|
||||||
|
|
||||||
|
await SecretImport.updateMany(
|
||||||
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
|
{ environment: environmentSlug }
|
||||||
|
);
|
||||||
|
|
||||||
|
await ServiceAccountWorkspacePermission.updateMany(
|
||||||
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
|
{ environment: environmentSlug }
|
||||||
|
);
|
||||||
|
|
||||||
|
await Webhook.updateMany(
|
||||||
|
{ workspace: workspaceId, environment: oldEnvironmentSlug },
|
||||||
|
{ environment: environmentSlug }
|
||||||
|
);
|
||||||
|
|
||||||
await Membership.updateMany(
|
await Membership.updateMany(
|
||||||
{
|
{
|
||||||
workspace: workspaceId,
|
workspace: workspaceId,
|
||||||
|
|||||||
Reference in New Issue
Block a user