From 36caf214a22e1bec7c8634bbe4e5e790590f7eea Mon Sep 17 00:00:00 2001 From: fikrimilano Date: Wed, 4 Dec 2024 13:00:08 +0700 Subject: [PATCH] Trigger task status update on draft submission --- .../quest/ui/questionnaire/QuestionnaireActivity.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt index 2bb53a31e0..5fcf848095 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireActivity.kt @@ -361,6 +361,14 @@ class QuestionnaireActivity : BaseMultiLanguageActivity() { lifecycleScope.launch { retrieveQuestionnaireResponse()?.let { questionnaireResponse -> viewModel.saveDraftQuestionnaire(questionnaireResponse, questionnaireConfig) + setResult( + Activity.RESULT_OK, + Intent().apply { + putExtra(QUESTIONNAIRE_RESPONSE, questionnaireResponse as Serializable) + putExtra(QUESTIONNAIRE_CONFIG, questionnaireConfig as Parcelable) + putExtra(ON_RESULT_TYPE, ActivityOnResultType.QUESTIONNAIRE.name) + }, + ) finish() } }