Make rotationIntervalSeconds nullable

This commit is contained in:
x032205
2025-10-21 16:21:52 -04:00
parent 65b36e6232
commit 85daaf806e
8 changed files with 12 additions and 11 deletions
@@ -14,7 +14,7 @@ export interface TBasePamAccount {
name: string;
description?: string | null;
rotationEnabled: boolean;
rotationIntervalSeconds: number;
rotationIntervalSeconds?: number | null;
lastRotatedAt?: string | null;
createdAt: string;
updatedAt: string;
@@ -6,7 +6,7 @@ import { FormControl, Select, SelectItem, Switch, Tooltip } from "@app/component
export const rotateAccountFieldsSchema = z.object({
rotationEnabled: z.boolean(),
rotationIntervalSeconds: z.number()
rotationIntervalSeconds: z.number().nullable().optional()
});
export const RotateAccountFields = ({
@@ -16,7 +16,7 @@ export const RotateAccountFields = ({
}) => {
const { control, watch } = useFormContext<{
rotationEnabled: boolean;
rotationIntervalSeconds: number;
rotationIntervalSeconds?: number | null;
}>();
const rotationEnabled = watch("rotationEnabled");
@@ -62,7 +62,7 @@ export const RotateAccountFields = ({
className="mb-0"
>
<Select
value={value.toString()}
value={(value || 2592000).toString()}
onValueChange={(val) => onChange(parseInt(val, 10))}
className="w-full border border-mineshaft-500 capitalize"
position="popper"