diff --git a/src/categories/components/CategoryCreatePage/form.tsx b/src/categories/components/CategoryCreatePage/form.tsx index 7c1344a0c..0393a005a 100644 --- a/src/categories/components/CategoryCreatePage/form.tsx +++ b/src/categories/components/CategoryCreatePage/form.tsx @@ -55,8 +55,6 @@ function useCategoryCreateForm( }); const { - isMetadataModified, - isPrivateMetadataModified, makeChangeHandler: makeMetadataChangeHandler } = useMetadataChangeTrigger(); @@ -69,7 +67,6 @@ function useCategoryCreateForm( // Need to make it function to always have description.current up to date const getData = (): CategoryCreateData => ({ ...form.data, - ...getMetadata(form.data, isMetadataModified, isPrivateMetadataModified), description: description.current }); diff --git a/src/categories/components/CategoryUpdatePage/form.tsx b/src/categories/components/CategoryUpdatePage/form.tsx index a98c80c1f..809b5a851 100644 --- a/src/categories/components/CategoryUpdatePage/form.tsx +++ b/src/categories/components/CategoryUpdatePage/form.tsx @@ -78,8 +78,12 @@ function useCategoryUpdateForm( ...getMetadata(form.data, isMetadataModified, isPrivateMetadataModified), description: description.current }); + const getSubmitData = (): CategoryUpdateData => ({ + ...getData(), + ...getMetadata(form.data, isMetadataModified, isPrivateMetadataModified) + }); - const submit = () => handleFormSubmit(getData(), onSubmit, setChanged); + const submit = () => handleFormSubmit(getSubmitData(), onSubmit, setChanged); return { change: handleChange,