Skip to content

Commit

Permalink
[FIX/#137] OCR 결과값 오류 분기처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Sep 18, 2024
1 parent f74f2d7 commit 8004d80
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ class SellOnboardingViewModel
viewModelScope.launch {
sellRepository.postToCheckProduct(SellCheckRequestModel(uploadedUrl))
.onSuccess {
productId = it.productId
productName = it.productName
productImage = it.imgUrl
_changingImageState.value = UiState.Success(it.productId)
if (it.productId.isNotEmpty()) {
productId = it.productId
productName = it.productName
productImage = it.imgUrl
_changingImageState.value = UiState.Success(it.productId)
} else {
_changingImageState.value = UiState.Failure(it.productId)
}
}
.onFailure {
_changingImageState.value = UiState.Failure(it.message.toString())
Expand Down

0 comments on commit 8004d80

Please sign in to comment.