Skip to content

Commit

Permalink
[Merge] #293 - Home filtering, total list 초기화 방지 에러
Browse files Browse the repository at this point in the history
[Fix] #292 - Home filtering, total list 초기화 방지 에러
  • Loading branch information
mcrkgus authored Nov 15, 2024
2 parents e6cb65a + cf4b205 commit 0133a00
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions Hankkijogbo/Hankkijogbo/Present/Home/View/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,12 @@ extension HomeViewController {
}

private extension HomeViewController {
func loadInitialData() {
universityId = UserDefaults.standard.getUniversity()?.id
viewModel.getHankkiListAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "") { [weak self] success in
let isEmpty = self?.viewModel.hankkiLists.isEmpty ?? true
self?.viewModel.onHankkiListFetchCompletion?(success, isEmpty)
}
viewModel.getHankkiPinAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "", completion: { _ in })
}

func updateUniversityData() {
let universityId = UserDefaults.standard.getUniversity()?.id

viewModel.getHankkiListAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "") { [weak self] success in
let isEmpty = self?.viewModel.hankkiLists.isEmpty ?? true
self?.viewModel.onHankkiListFetchCompletion?(success, isEmpty)
}
viewModel.getHankkiPinAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "", completion: { _ in })
rootView.bottomSheetView.totalListCollectionView.reloadData()
viewModel.updateHankkiList()

// 대학 선택 후 홈화면 재진입 시 해당 대학교에 맞게 reset
rootView.bottomSheetView.totalListCollectionView.reloadData()
hideMarkerInfoCard()
rootView.bottomSheetView.viewLayoutIfNeededWithDownAnimation()
}
Expand Down

0 comments on commit 0133a00

Please sign in to comment.