Skip to content

Commit

Permalink
refactor : 불필요한 updateSelectedDate 함수 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwoo-jo committed Feb 22, 2024
1 parent ab90dda commit 995282b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CafeteriaViewModel(
is NetworkResult.Success -> {
val menuList = result.data
_cafeteriaList.value = menuList
updateSelectedDate(LocalDate.now())
_selectedDate.value = LocalDate.now()
updateMenuList(selectedDate.toString())
_isError.postValue(false)
_isLoading.postValue(false)
}
Expand All @@ -60,11 +61,6 @@ class CafeteriaViewModel(
}
}

fun updateSelectedDate(selectedDate: LocalDate) {
_selectedDate.value = selectedDate
updateMenuList(selectedDate.toString())
}

private fun updateMenuList(selectedDate: String) {
val cafeteriaList = _cafeteriaList.value ?: emptyList()

Expand Down

0 comments on commit 995282b

Please sign in to comment.