refactor: improve TTL validation logic in EditDynamicSecretRabbitMqForm to ensure proper limits

This commit is contained in:
Victor Santos
2025-10-27 16:05:08 -03:00
parent 28b37efd60
commit 0d778dd737

View File

@@ -35,7 +35,7 @@ const formSchema = z.object({
const valMs = ms(val);
if (valMs < 60 * 1000)
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be a greater than 1min" });
if (valMs > ms("10y"))
if (valMs > ms("10y"))
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be less than 10 years" });
}),
maxTTL: z