-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 커뮤니티 탭 에러 수정 #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[Fix] 커뮤니티 탭 에러 수정 #234
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bf2bf76
[Fix] #233 - 오류 상황 해결 및 로직 수정
JinUng41 5e82305
[Refactor] #233 - Combine 친화적으로 로직 수정
JinUng41 3ff0276
[Chore] #233 - 잘못된 값 수정
JinUng41 1d61af2
[Refactor] #233 - 유즈케이스 삭제 및 레포지토리 메서드 네이밍 변경
JinUng41 6f80813
[Chore] #233 - DI 코드 간결화
JinUng41 bd1185a
[Refactor] #233 - `flatMap`에 리턴형 타입 명시
JinUng41 1bc6f63
Merge branch 'develop' of https://github.com/Team-Wable/WABLE-iOS int…
JinUng41 4b18f7c
Merge branch 'develop' of https://github.com/Team-Wable/WABLE-iOS int…
JinUng41 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ final class CommunityRepositoryImpl { | |
| } | ||
|
|
||
| extension CommunityRepositoryImpl: CommunityRepository { | ||
| func updateRegister(communityName: String) -> AnyPublisher<Double, WableError> { | ||
| func updateRegistration(communityName: String) -> AnyPublisher<Double, WableError> { | ||
| return provider.request( | ||
| .updateRegister( | ||
| request: DTO.Request.UpdateRegister( | ||
|
|
@@ -39,9 +39,45 @@ extension CommunityRepositoryImpl: CommunityRepository { | |
| .mapWableError() | ||
| } | ||
|
|
||
| func isUserRegistered() -> AnyPublisher<CommunityRegistration, WableError> { | ||
| func checkUserRegistration() -> AnyPublisher<CommunityRegistration, WableError> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 함수 이름이 깔끔해졌네요! 확실히 동사+주어 조합이 깔끔하고 알아보기 쉬운 것 같습니다. 👍 |
||
| return provider.request(.isUserRegistered, for: DTO.Response.IsUserRegistered.self) | ||
| .map(CommunityMapper.toDomain) | ||
| .mapWableError() | ||
| } | ||
| } | ||
|
|
||
| struct MockCommunityRepository: CommunityRepository { | ||
| private var randomDelay: TimeInterval { Double.random(in: 0.7...1.3) } | ||
|
|
||
| func updateRegistration(communityName: String) -> AnyPublisher<Double, WableError> { | ||
| return .just(88.0) | ||
| .delay(for: .seconds(randomDelay), scheduler: DispatchQueue.main) | ||
| .eraseToAnyPublisher() | ||
| } | ||
|
|
||
| func fetchCommunityList() -> AnyPublisher<[Community], WableError> { | ||
| let communityMockData: [Community] = [ | ||
| Community(team: .t1, registrationRate: 0.91), | ||
| Community(team: .gen, registrationRate: 0.88), | ||
| Community(team: .hle, registrationRate: 0.72), | ||
| Community(team: .dk, registrationRate: 0.79), | ||
| Community(team: .kt, registrationRate: 0.65), | ||
| Community(team: .ns, registrationRate: 0.54), | ||
| Community(team: .drx, registrationRate: 0.49), | ||
| Community(team: .bro, registrationRate: 0.37), | ||
| Community(team: .bfx, registrationRate: 0.42), | ||
| Community(team: .dnf, registrationRate: 0.33) | ||
| ] | ||
|
|
||
| return .just(communityMockData) | ||
| .delay(for: .seconds(randomDelay), scheduler: DispatchQueue.main) | ||
| .eraseToAnyPublisher() | ||
| } | ||
|
|
||
| func checkUserRegistration() -> AnyPublisher<CommunityRegistration, WableError> { | ||
| let registration = CommunityRegistration(team: nil, hasRegisteredTeam: false) | ||
| return .just(registration) | ||
| .delay(for: .seconds(randomDelay), scheduler: DispatchQueue.main) | ||
| .eraseToAnyPublisher() | ||
| } | ||
| } | ||
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는
Switch문이 한줄만 있어도 줄바꿈을 하는 편이라... 이런 부분은 이야기해보고 맞추면 좋지 않을까 생각이 들어요.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드를 많이 작성하다 보니, 가장 간결한게 최고인 것 같아서 우선 개행하지 않는 편으로 작성하게 되었습니다.
다가오는 토의 시간에 이야기를 해보면 좋을 것 같아요.