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