diff --git a/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt b/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt index 8ebcbfb554..2736ca32b5 100644 --- a/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt +++ b/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt @@ -63,19 +63,24 @@ fun ActivateScreen( ActivateScreen( state = state, onActivate = { + val clientIdAsInt: Int = try { + id + } catch (e: Exception) { + 0 + } when (activateType) { Constants.ACTIVATE_CLIENT -> viewModel.activateClient( - clientId = id, + clientId = clientIdAsInt, clientPayload = it ) Constants.ACTIVATE_CENTER -> viewModel.activateCenter( - centerId = id, + centerId = clientIdAsInt, centerPayload = it ) Constants.ACTIVATE_GROUP -> viewModel.activateGroup( - groupId = id, + groupId = clientIdAsInt, groupPayload = it )