From aa3559117dde909d568da27e1300d1a909c5ac4e Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 3 Nov 2020 18:25:35 +0100 Subject: [PATCH] Fix isPublished flag --- src/collections/components/CollectionDetailsPage/form.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/collections/components/CollectionDetailsPage/form.tsx b/src/collections/components/CollectionDetailsPage/form.tsx index e5cb9bfc7..a5dd5417e 100644 --- a/src/collections/components/CollectionDetailsPage/form.tsx +++ b/src/collections/components/CollectionDetailsPage/form.tsx @@ -83,13 +83,13 @@ function useCollectionUpdateForm( // Need to make it function to always have description.current up to date const getData = (): CollectionUpdateData => ({ ...form.data, - description: description.current, - isPublished: form.data.isPublished || !!form.data.publicationDate + description: description.current }); const getSubmitData = (): CollectionUpdateData => ({ ...getData(), - ...getMetadata(form.data, isMetadataModified, isPrivateMetadataModified) + ...getMetadata(form.data, isMetadataModified, isPrivateMetadataModified), + isPublished: form.data.isPublished || !!form.data.publicationDate }); const submit = () => handleFormSubmit(getSubmitData(), onSubmit, setChanged);