From 8004d806b1021779f3f628391cde35bc05ccc207 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Thu, 19 Sep 2024 03:48:42 +0900 Subject: [PATCH] =?UTF-8?q?[FIX/#137]=20OCR=20=EA=B2=B0=EA=B3=BC=EA=B0=92?= =?UTF-8?q?=20=EC=98=A4=EB=A5=98=20=EB=B6=84=EA=B8=B0=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sell/onboarding/SellOnboardingViewModel.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/feature/sell/src/main/java/co/orange/sell/onboarding/SellOnboardingViewModel.kt b/feature/sell/src/main/java/co/orange/sell/onboarding/SellOnboardingViewModel.kt index 780f342..d87ccb8 100644 --- a/feature/sell/src/main/java/co/orange/sell/onboarding/SellOnboardingViewModel.kt +++ b/feature/sell/src/main/java/co/orange/sell/onboarding/SellOnboardingViewModel.kt @@ -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())