mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge branch 'daniel/assignment' of https://github.com/DanielHougaard/infisical into daniel/assignment
This commit is contained in:
@@ -1138,6 +1138,38 @@ export const updateSecretByName = async (req: Request, res: Response) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (type !== "personal") {
|
||||
const existingSecret = await SecretService.getSecret({
|
||||
secretName,
|
||||
workspaceId: new Types.ObjectId(workspaceId),
|
||||
environment,
|
||||
type,
|
||||
secretPath,
|
||||
authData: req.authData
|
||||
});
|
||||
|
||||
if (
|
||||
(secretReminderCron && existingSecret.secretReminderCron !== secretReminderCron) ||
|
||||
(secretReminderNote && existingSecret.secretReminderNote !== secretReminderNote)
|
||||
) {
|
||||
await createReminder(existingSecret, {
|
||||
_id: existingSecret._id,
|
||||
secretReminderCron,
|
||||
secretReminderNote,
|
||||
workspace: existingSecret.workspace
|
||||
});
|
||||
} else if (
|
||||
secretReminderCron === null &&
|
||||
secretReminderNote === null &&
|
||||
existingSecret.secretReminderCron
|
||||
) {
|
||||
await deleteReminder({
|
||||
_id: existingSecret._id,
|
||||
secretReminderCron: existingSecret.secretReminderCron
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const secret = await SecretService.updateSecret({
|
||||
secretName,
|
||||
workspaceId: new Types.ObjectId(workspaceId),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ISecret } from "../models";
|
||||
import {
|
||||
createSecretReminderCron,
|
||||
deleteSecretReminderCron,
|
||||
updateSecretReminderCron
|
||||
} from "../queues/reminders/sendSecretReminders";
|
||||
import { ISecret } from "../models";
|
||||
|
||||
type TPartialSecret = Pick<
|
||||
ISecret,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Types } from "mongoose";
|
||||
import { sendMail } from "../../helpers";
|
||||
import Queue, { Job } from "bull";
|
||||
import { IUser, Membership, Organization, Workspace } from "../../models";
|
||||
import { Types } from "mongoose";
|
||||
import { sendMail } from "../../helpers";
|
||||
|
||||
type TSendSecretReminders = {
|
||||
workspaceId: string;
|
||||
|
||||
Reference in New Issue
Block a user