mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +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({
|
const secret = await SecretService.updateSecret({
|
||||||
secretName,
|
secretName,
|
||||||
workspaceId: new Types.ObjectId(workspaceId),
|
workspaceId: new Types.ObjectId(workspaceId),
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import { ISecret } from "../models";
|
||||||
import {
|
import {
|
||||||
createSecretReminderCron,
|
createSecretReminderCron,
|
||||||
deleteSecretReminderCron,
|
deleteSecretReminderCron,
|
||||||
updateSecretReminderCron
|
updateSecretReminderCron
|
||||||
} from "../queues/reminders/sendSecretReminders";
|
} from "../queues/reminders/sendSecretReminders";
|
||||||
import { ISecret } from "../models";
|
|
||||||
|
|
||||||
type TPartialSecret = Pick<
|
type TPartialSecret = Pick<
|
||||||
ISecret,
|
ISecret,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Types } from "mongoose";
|
|
||||||
import { sendMail } from "../../helpers";
|
|
||||||
import Queue, { Job } from "bull";
|
import Queue, { Job } from "bull";
|
||||||
import { IUser, Membership, Organization, Workspace } from "../../models";
|
import { IUser, Membership, Organization, Workspace } from "../../models";
|
||||||
|
import { Types } from "mongoose";
|
||||||
|
import { sendMail } from "../../helpers";
|
||||||
|
|
||||||
type TSendSecretReminders = {
|
type TSendSecretReminders = {
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user