From 17d8b33e7ec7526316db4e1b5b44dfc2cc33c292 Mon Sep 17 00:00:00 2001 From: Sean Fong Date: Mon, 23 Dec 2024 10:18:31 +1030 Subject: [PATCH] Add await to other instances of updatedPopulatedProperties call --- .../features/repopulate/components/RepopulateSelectDialog.tsx | 4 ++-- packages/smart-forms-renderer/src/utils/manageForm.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/smart-forms-app/src/features/repopulate/components/RepopulateSelectDialog.tsx b/apps/smart-forms-app/src/features/repopulate/components/RepopulateSelectDialog.tsx index 711bb0038..b6e378e76 100644 --- a/apps/smart-forms-app/src/features/repopulate/components/RepopulateSelectDialog.tsx +++ b/apps/smart-forms-app/src/features/repopulate/components/RepopulateSelectDialog.tsx @@ -77,7 +77,7 @@ function RepopulateSelectDialog(props: RepopulateSelectDialogProps) { setCheckedLinkIds(newCheckedIds); } - function handleConfirmRepopulate() { + async function handleConfirmRepopulate() { const checkedRepopulatedItems = filterCheckedItemsToRepopulate( itemsToRepopulate, checkedLinkIds @@ -93,7 +93,7 @@ function RepopulateSelectDialog(props: RepopulateSelectDialogProps) { }); const repopulatedResponse = repopulateResponse(checkedRepopulatedItems); - const updatedResponse = updatePopulatedProperties(repopulatedResponse, undefined, true); + const updatedResponse = await updatePopulatedProperties(repopulatedResponse, undefined, true); setUpdatableResponseAsPopulated(updatedResponse); onCloseDialog(); diff --git a/packages/smart-forms-renderer/src/utils/manageForm.ts b/packages/smart-forms-renderer/src/utils/manageForm.ts index 6af8ed9bc..8a111fc1b 100644 --- a/packages/smart-forms-renderer/src/utils/manageForm.ts +++ b/packages/smart-forms-renderer/src/utils/manageForm.ts @@ -63,7 +63,7 @@ export async function buildForm( questionnaireResponse ); questionnaireResponseStore.getState().buildSourceResponse(initialisedQuestionnaireResponse); - questionnaireStore.getState().updatePopulatedProperties(initialisedQuestionnaireResponse); + await questionnaireStore.getState().updatePopulatedProperties(initialisedQuestionnaireResponse); if (readOnly) { questionnaireStore.getState().setFormAsReadOnly(readOnly);