mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 09:27:50 +00:00
Fix bug with updating overwritten secrets
This commit is contained in:
@@ -1116,25 +1116,27 @@ export const updateSecretByName = async (req: Request, res: Response) => {
|
|||||||
authData: req.authData
|
authData: req.authData
|
||||||
});
|
});
|
||||||
|
|
||||||
if (
|
if (secretReminderCron !== undefined) {
|
||||||
(secretReminderCron && existingSecret.secretReminderCron !== secretReminderCron) ||
|
if (
|
||||||
(secretReminderNote && existingSecret.secretReminderNote !== secretReminderNote)
|
(secretReminderCron && existingSecret.secretReminderCron !== secretReminderCron) ||
|
||||||
) {
|
(secretReminderNote && existingSecret.secretReminderNote !== secretReminderNote)
|
||||||
await createReminder(existingSecret, {
|
) {
|
||||||
_id: existingSecret._id,
|
await createReminder(existingSecret, {
|
||||||
secretReminderCron,
|
_id: existingSecret._id,
|
||||||
secretReminderNote,
|
secretReminderCron,
|
||||||
workspace: existingSecret.workspace
|
secretReminderNote,
|
||||||
});
|
workspace: existingSecret.workspace
|
||||||
} else if (
|
});
|
||||||
secretReminderCron === null &&
|
} else if (
|
||||||
secretReminderNote === null &&
|
secretReminderCron === null &&
|
||||||
existingSecret.secretReminderCron
|
secretReminderNote === null &&
|
||||||
) {
|
existingSecret.secretReminderCron
|
||||||
await deleteReminder({
|
) {
|
||||||
_id: existingSecret._id,
|
await deleteReminder({
|
||||||
secretReminderCron: existingSecret.secretReminderCron
|
_id: existingSecret._id,
|
||||||
});
|
secretReminderCron: existingSecret.secretReminderCron
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ export const UpdateSecretByNameV3 = z.object({
|
|||||||
.trim()
|
.trim()
|
||||||
.optional()
|
.optional()
|
||||||
.nullable()
|
.nullable()
|
||||||
.refine((val) => val === null || (val && isValidCron(val))),
|
.refine((val) => val === null || val === undefined || (val && isValidCron(val))),
|
||||||
secretReminderNote: z.string().trim().nullable().optional(),
|
secretReminderNote: z.string().trim().nullable().optional(),
|
||||||
|
|
||||||
tags: z.string().array().optional(),
|
tags: z.string().array().optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user