From 23888c51da7fab37b972439b0352b4ca0e92756c Mon Sep 17 00:00:00 2001 From: hexastack Date: Wed, 5 Feb 2025 17:03:18 +0100 Subject: [PATCH] fix: reset form --- frontend/src/components/content-types/ContentTypeDialog.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/content-types/ContentTypeDialog.tsx b/frontend/src/components/content-types/ContentTypeDialog.tsx index 5dd9c0f3..3c248040 100644 --- a/frontend/src/components/content-types/ContentTypeDialog.tsx +++ b/frontend/src/components/content-types/ContentTypeDialog.tsx @@ -25,7 +25,7 @@ import { EntityType } from "@/services/types"; import { ContentFieldType, IContentType } from "@/types/content-type.types"; import { FieldInput } from "./components/FieldInput"; -import { FIELDS_FORM_DEFAULT_VALUES, READ_ONLY_FIELDS } from "./constants"; +import { READ_ONLY_FIELDS } from "./constants"; export type ContentTypeDialogProps = DialogControlProps; export const ContentTypeDialog: FC = ({ @@ -45,7 +45,7 @@ export const ContentTypeDialog: FC = ({ } = useForm>({ defaultValues: { name: data?.name || "", - fields: data?.fields || FIELDS_FORM_DEFAULT_VALUES, + fields: data?.fields || [], }, }); const { append, fields, remove } = useFieldArray({ @@ -90,7 +90,7 @@ export const ContentTypeDialog: FC = ({ if (data) { reset({ name: data.name, - fields: data.fields || FIELDS_FORM_DEFAULT_VALUES, + fields: data.fields || [], }); } else { reset();