[feat/#338] 내가 등록한 장소 UI 구현 및 api 연결#351
Merged
seojoozero merged 9 commits intodevelopfrom Nov 26, 2025
Merged
Conversation
Closed
1 task
SeungWon1125
approved these changes
Nov 26, 2025
Comment on lines
+24
to
+50
| func fetchRegisteredPlaces( | ||
| userId: Int, | ||
| page: Int = 0, | ||
| size: Int = 100 | ||
| ) async -> RegisteredPlacesAction { | ||
| do { | ||
| let response = try await userService.fetchRegisteredPlaces( | ||
| userId: userId, | ||
| page: page, | ||
| size: size | ||
| ) | ||
|
|
||
| guard let data = response.data else { | ||
| return .fetchRegisteredPlacesFailed(error: .responseError) | ||
| } | ||
|
|
||
| let places = data.content.map { RegisteredPlace(dto: $0) } | ||
|
|
||
| return .registeredPlacesFetched(places) | ||
|
|
||
| } catch let error as NetworkError { | ||
| return .fetchRegisteredPlacesFailed(error: error) | ||
| } catch { | ||
| return .fetchRegisteredPlacesFailed(error: .unknownError) | ||
| } | ||
| } | ||
| } |
| import Foundation | ||
|
|
||
| enum RegisteredPlacesAction { | ||
| case fetchRegisteredPlaces(userId: Int, page: Int = 0, size: Int = 100) |
Collaborator
There was a problem hiding this comment.
Effect에서 함수 인자에 기본값이 있어서 여기는 설정 안 해도 괜찮아 보입니다~!
| Task { | ||
| let results = await effect.fetchRegisteredPlaces(userId: userId) | ||
| self.dispatch(results) | ||
| } |
Collaborator
There was a problem hiding this comment.
보니까 여기서 page랑 size를 아에 안 쓰네요 나중에 수정해야할 때 번거로울 수 있으니 여기서는 userId, page, size 다 넘겨서 사용하는 거로 하고, .fetchRegisteredPlaces 호출하는 곳에서 page = 0랑 size = 100 넣어주는 건 어떤가요?
그럼 Effect에서 기본값 설정 안 해줘도 될 거 같은데
dudwntjs
approved these changes
Nov 26, 2025
|
|
||
| // MARK: - Properties | ||
|
|
||
| @EnvironmentObject private var appState: AppState |
Contributor
There was a problem hiding this comment.
이 친구는 어디서 쓰이고 있는 거조??! 필요없으면 지워도 댈 것 같아유
| state.registeredPlaces = places | ||
| case .fetchRegisteredPlacesFailed(let error): | ||
| state.error = error | ||
| print(error) |
Contributor
There was a problem hiding this comment.
reducer는 순수 함수니깐용 이거 지우는 거 어떨까유 헷
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


📄 작업 내용
🔗 연결된 이슈