diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt index b2430fe56e..c949da5165 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/questionnaire/QuestionnaireViewModel.kt @@ -705,11 +705,10 @@ constructor( * This function saves [QuestionnaireResponse] as draft if any of the [QuestionnaireResponse.item] * has an answer. */ - fun saveDraftQuestionnaire( + suspend fun saveDraftQuestionnaire( questionnaireResponse: QuestionnaireResponse, questionnaireConfig: QuestionnaireConfig, ) { - viewModelScope.launch { val hasPages = questionnaireResponse.item.any { it.hasItem() } val questionnaireHasAnswer = questionnaireResponse.item.any { @@ -741,7 +740,6 @@ constructor( resource = questionnaireResponse, ) } - } } /**