Skip to content

Commit

Permalink
fix: Save closed message on Form management (#4511)
Browse files Browse the repository at this point in the history
Remove early return so save still fires
  • Loading branch information
dsamojlenko authored Oct 29, 2024
1 parent 4fb7dbf commit 18a2f75
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -113,7 +109,7 @@ export const SetClosingDate = ({

const result = await closeForm({
id: formId,
closingDate: closeDate,
closingDate: closeDate || null,
closedDetails: closedMessage,
});

Expand All @@ -123,7 +119,7 @@ export const SetClosingDate = ({
}

// Setting local store
setClosingDate(closeDate);
setClosingDate(closeDate || null);

if (status === "closed") {
toast.success(<ClosedSuccess />, "wide");
Expand Down

0 comments on commit 18a2f75

Please sign in to comment.