mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 18:27:36 +00:00
Handle deletion
This commit is contained in:
committed by
Akhil Mohan
parent
3b39e38c89
commit
0afb44af29
@@ -17,6 +17,7 @@ import { getConfig } from "@app/lib/config/env";
|
|||||||
import { buildSecretBlindIndexFromName, encryptSymmetric128BitHexKeyUTF8 } from "@app/lib/crypto";
|
import { buildSecretBlindIndexFromName, encryptSymmetric128BitHexKeyUTF8 } from "@app/lib/crypto";
|
||||||
import { BadRequestError } from "@app/lib/errors";
|
import { BadRequestError } from "@app/lib/errors";
|
||||||
import { groupBy, pick } from "@app/lib/fn";
|
import { groupBy, pick } from "@app/lib/fn";
|
||||||
|
import { logger } from "@app/lib/logger";
|
||||||
|
|
||||||
import { ActorType } from "../auth/auth-type";
|
import { ActorType } from "../auth/auth-type";
|
||||||
import { TProjectBotServiceFactory } from "../project-bot/project-bot-service";
|
import { TProjectBotServiceFactory } from "../project-bot/project-bot-service";
|
||||||
@@ -207,6 +208,21 @@ export const secretServiceFactory = ({
|
|||||||
actorId,
|
actorId,
|
||||||
tx
|
tx
|
||||||
);
|
);
|
||||||
|
|
||||||
|
for (const s of deletedSecrets) {
|
||||||
|
if (s.secretReminderRepeatDays) {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await secretReminderService
|
||||||
|
.deleteReminder({
|
||||||
|
secretId: s.id,
|
||||||
|
repeatDays: s.secretReminderRepeatDays
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
logger.error(err, `Failed to delete secret reminder for secret with ID ${s?.id}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return deletedSecrets;
|
return deletedSecrets;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user