Skip to content

Commit

Permalink
link context care
Browse files Browse the repository at this point in the history
  • Loading branch information
RawatH committed Sep 30, 2023
1 parent 6387017 commit db70b44
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ class CCLinkFragment :
}

is GenerateAbhaUiState.Success -> {
binding.linkInfoTxt.text = resources.getString(R.string.linking_cc_success)
viewModel.uiState.emit(GenerateAbhaUiState.Loading(false))
binding.retryLink.visibility = View.GONE
binding.retryLink.isEnabled = false

}

is GenerateAbhaUiState.AbdmError -> {
binding.linkInfoTxt.text = resources.getString(R.string.linking_cc_error)
binding.retryLink.visibility = View.VISIBLE
binding.retryLink.isEnabled = true
viewModel.uiState.emit(GenerateAbhaUiState.Loading(false))
Expand All @@ -60,6 +62,7 @@ class CCLinkFragment :
}

is GenerateAbhaUiState.Error -> {
binding.linkInfoTxt.text = resources.getString(R.string.linking_cc_error)
binding.retryLink.visibility = View.VISIBLE
binding.retryLink.isEnabled = true
(activity as AbdmActivity).showBlockerDialog(it.data.get("message").asString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class CareContextViewModel @Inject constructor(
uiState.emit(
GenerateAbhaUiState.AbdmError(
hqRespModel.value,
RequestType.CC_AUTH_CONFIRM
RequestType.CC_LINK
)
)
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-hi-rIN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,6 @@
<string name="ccDetails">CareContext Detail</string>
<string name="linking_cc">Linking context care...</string>
<string name="retryLink">Link Context Care</string>
<string name="linking_cc_success">Context care linked successfully.</string>
<string name="linking_cc_error">Context care not linked. Please retry.</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ Please fill this field if the beneficiary is interested in a custom ABHA address
<string name="ccDetails">CareContext Detail</string>
<string name="linking_cc">Linking context care...</string>
<string name="retryLink">Link Context Care</string>
<string name="linking_cc_success">Context care linked successfully.</string>
<string name="linking_cc_error">Context care not linked. Please retry.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ interface HqServices {
@POST("user_auth/auth_confirm")
suspend fun confirmCareContextAuth(@Body confirmAuthModel: ConfirmAuthModel):Response<JsonObject>
@POST("hip/link_care_context")
suspend fun linkCareContext(careContextLinkModel:CCLinkModel):Response<JsonObject>
suspend fun linkCareContext(@Body careContextLinkModel:CCLinkModel):Response<JsonObject>

}

0 comments on commit db70b44

Please sign in to comment.