From 18a2f750c22463008fb0c7027011b49636a329e5 Mon Sep 17 00:00:00 2001 From: Dave Samojlenko Date: Tue, 29 Oct 2024 13:28:25 -0400 Subject: [PATCH] fix: Save closed message on Form management (#4511) Remove early return so save still fires --- .../[id]/settings/manage/close/SetClosingDate.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/(gcforms)/[locale]/(form administration)/form-builder/[id]/settings/manage/close/SetClosingDate.tsx b/app/(gcforms)/[locale]/(form administration)/form-builder/[id]/settings/manage/close/SetClosingDate.tsx index 9f6ad29c9a..1286409d0a 100644 --- a/app/(gcforms)/[locale]/(form administration)/form-builder/[id]/settings/manage/close/SetClosingDate.tsx +++ b/app/(gcforms)/[locale]/(form administration)/form-builder/[id]/settings/manage/close/SetClosingDate.tsx @@ -97,10 +97,6 @@ export const SetClosingDate = ({ ); const saveFormStatus = useCallback(async () => { - if (closingDate === undefined) { - return; - } - // Check to see if the existing date is in the past when updating the toggle. If the date is in // the future we want to keep the existing value. let closeDate = isFutureDate(String(closingDate)) ? closingDate : null; @@ -113,7 +109,7 @@ export const SetClosingDate = ({ const result = await closeForm({ id: formId, - closingDate: closeDate, + closingDate: closeDate || null, closedDetails: closedMessage, }); @@ -123,7 +119,7 @@ export const SetClosingDate = ({ } // Setting local store - setClosingDate(closeDate); + setClosingDate(closeDate || null); if (status === "closed") { toast.success(, "wide");