fix(cluster-settings): ensure data validation for registryId in form defaults

This commit is contained in:
Mauricio Siu
2025-08-03 16:40:24 -06:00
parent 6e79183f6a
commit 3d10d48425

View File

@@ -79,7 +79,7 @@ export const ShowClusterSettings = ({ id, type }: Props) => {
const form = useForm<AddCommand>({
defaultValues: {
...(type === "application" && "registryId" in data
...(type === "application" && data && "registryId" in data
? {
registryId: data?.registryId || "",
}
@@ -92,7 +92,7 @@ export const ShowClusterSettings = ({ id, type }: Props) => {
useEffect(() => {
if (data?.command) {
form.reset({
...(type === "application" && "registryId" in data
...(type === "application" && data && "registryId" in data
? {
registryId: data?.registryId || "",
}