From 3b059fb29e5e1d5c022301bcd0846cf7fb22e97f Mon Sep 17 00:00:00 2001 From: Dan2dani Date: Mon, 2 Sep 2024 16:43:11 +0900 Subject: [PATCH] =?UTF-8?q?[mod]=20#236=20=ED=99=88=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=EB=A1=9C=20=EC=B2=98=EB=A6=AC=ED=96=88?= =?UTF-8?q?=EB=8D=98=20=EB=A1=9C=EC=A7=81=20=EB=B9=84=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9C=20=EB=90=98=EB=8F=8C=EB=A6=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sopt/geonppang/presentation/home/HomeViewModel.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/sopt/geonppang/presentation/home/HomeViewModel.kt b/app/src/main/java/com/sopt/geonppang/presentation/home/HomeViewModel.kt index 85aa728f..7fcce74d 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/home/HomeViewModel.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/home/HomeViewModel.kt @@ -43,8 +43,7 @@ class HomeViewModel @Inject constructor( fetchBestList() } - // 하나의 스코프를 만들어서 각 함수들이 동기적으로 처리되도록 수정 - fun fetchBestList() { + private fun fetchBestList() { viewModelScope.launch { homeRepository.fetchBestBakery() .onSuccess { bestBakeryList -> @@ -53,7 +52,9 @@ class HomeViewModel @Inject constructor( .onFailure { throwable -> _bestBakeryListState.value = UiState.Error(throwable.message) } + } + viewModelScope.launch { homeRepository.fetchBestReview() .onSuccess { bestReviewList -> _bestReviewListState.value = UiState.Success(bestReviewList)