mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 06:28:15 +00:00
fix: default duplicate secret deletion
This commit is contained in:
@@ -424,8 +424,10 @@ export const fnSecretBulkDelete = async ({
|
||||
.filter(({ type }) => type === SecretType.Shared)
|
||||
.map(({ id }) => ({
|
||||
type: CommitType.DELETE,
|
||||
secretVersionId: secretVersions[id].id
|
||||
}));
|
||||
secretVersionId: secretVersions[id]?.id
|
||||
}))
|
||||
.filter((el) => el.secretVersionId);
|
||||
|
||||
if (changes.length > 0) {
|
||||
if (commitChanges) {
|
||||
commitChanges.push(...changes);
|
||||
|
||||
@@ -2254,7 +2254,8 @@ export const secretV2BridgeServiceFactory = ({
|
||||
]
|
||||
}
|
||||
});
|
||||
if (secretsToDelete.length !== inputSecrets.length)
|
||||
const secretsToDeleteSet = new Set(secretsToDelete.map((el) => el.key));
|
||||
if (secretsToDeleteSet.size !== inputSecrets.length)
|
||||
throw new NotFoundError({
|
||||
message: `One or more secrets does not exist: ${secretsToDelete.map((el) => el.key).join(", ")}`
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user