mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 06:28:11 +00:00
patch env delete bug
This commit is contained in:
@@ -191,14 +191,21 @@ export const deleteWorkspaceEnvironment = async (
|
|||||||
workspace: workspaceId,
|
workspace: workspaceId,
|
||||||
environment: environmentSlug,
|
environment: environmentSlug,
|
||||||
});
|
});
|
||||||
await ServiceToken.deleteMany({
|
|
||||||
workspace: workspaceId,
|
// await ServiceToken.deleteMany({
|
||||||
environment: environmentSlug,
|
// workspace: workspaceId,
|
||||||
});
|
// environment: environmentSlug,
|
||||||
await ServiceTokenData.deleteMany({
|
// });
|
||||||
workspace: workspaceId,
|
|
||||||
environment: environmentSlug,
|
const result = await ServiceTokenData.updateMany(
|
||||||
});
|
{ workspace: workspaceId },
|
||||||
|
{ $pull: { scopes: { environment: environmentSlug } } }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result.modifiedCount > 0) {
|
||||||
|
await ServiceTokenData.deleteMany({ workspace: workspaceId, scopes: { $size: 0 } });
|
||||||
|
}
|
||||||
|
|
||||||
await Integration.deleteMany({
|
await Integration.deleteMany({
|
||||||
workspace: workspaceId,
|
workspace: workspaceId,
|
||||||
environment: environmentSlug,
|
environment: environmentSlug,
|
||||||
|
|||||||
Reference in New Issue
Block a user