fix rotation account configured detection

This commit is contained in:
x032205
2025-10-20 20:46:15 -04:00
parent 64b3d61325
commit 2b6fcb2564
3 changed files with 7 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ export const BasePamAccountSchemaWithResource = BasePamAccountSchema.extend({
id: true,
name: true,
resourceType: true
}).extend({
rotationCredentialsConfigured: z.boolean()
})
});

View File

@@ -54,7 +54,7 @@ export const PostgresAccountForm = ({ account, resourceId, onSubmit }: Props) =>
} else {
setRotationCredentialsConfigured(!!resource?.rotationAccountCredentials);
}
}, [account]);
}, [account, resource]);
return (
<FormProvider {...form}>

View File

@@ -22,7 +22,10 @@ export const RotateAccountFields = ({
const rotationEnabled = watch("rotationEnabled");
return (
<Tooltip content="The resource which owns this account does not have rotation credentials configured.">
<Tooltip
isDisabled={rotationCredentialsConfigured}
content="The resource which owns this account does not have rotation credentials configured."
>
<div
className={twMerge(
"flex h-9 w-fit items-center gap-3",