Refactor/#413 코드리뷰 반영#433
Merged
juri123123 merged 3 commits intodevelopfrom May 6, 2026
Hidden character warning
The head ref may contain hidden characters: "refactor/#413-\ucf54\ub4dc\ub9ac\ubdf0-\ubc18\uc601"
Merged
Conversation
Closed
1 task
y-eonee
approved these changes
May 5, 2026
|
|
||
| func fetchAIAnswer(questID: Int, isAnswerExists: Bool) async throws -> AIAnswerEntity { | ||
| func fetchAIAnswer(questID: Int) async throws -> AIAnswerEntity { | ||
| // throw ByeBooError.unknownError |
Collaborator
Author
There was a problem hiding this comment.
요 주석은 error를 던지는 경우를 테스트하기 위함입니닷!!!!
Comment on lines
+85
to
+88
| private func cancelTask() { | ||
| fetchAIAnswerTask?.cancel() | ||
| fetchAIAnswerTask = nil | ||
| } |
dev-domo
approved these changes
May 6, 2026
| decodingType: AIAnswerResponseDTO.self | ||
| ) | ||
| } | ||
| func fetchAIAnswer(questID: Int) async throws -> AIAnswerEntity { |
Collaborator
There was a problem hiding this comment.
답장 존재 유무와 상관없이 계속 create을 하게 되나요?
Collaborator
Author
There was a problem hiding this comment.
답장 존재 유무를 판단하고 fetch 할지 create 할지 결정하는 역할을 usecase로 넘겼습니다 !
| extension AIAnswerViewModel { | ||
| private func fetchAIAnswer() { | ||
| Task { | ||
| fetchAIAnswerTask?.cancel() |
Collaborator
There was a problem hiding this comment.
fetchAIAnswerTask?.cancel() 대신 만들어놓은 cancelTask를 호출하는 방법도 괜찮을 것 같아요!
Collaborator
Author
There was a problem hiding this comment.
좋은 의견 감사합니다 !!!
추후 fetch하는 task가 많아질 경우 cancelTask 내부에 task들을 취소하는 로직을 모두 넣을 예정이라 통일성을 위해 분리해서 사용할 수 있도록 이렇게 작성했습니닷 !
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.
🔗 연결된 이슈
📄 작업 내용
usecase로 변경했습니다.💻 주요 코드 설명
AIAnswerViewModel