-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat] #44 - 질문지 문제 풀기 API 구현 #46
base: main
Are you sure you want to change the base?
Conversation
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.
레전드개발자 ;; ☃️
} else { | ||
completion(.failure(.networkFail)) | ||
print("응답에서 초대 코드를 찾을 수 없습니다.") | ||
} |
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.
이 부분을 따로 분기처리해준 이유가 있나요?
아마 200인데 count 데이터가 없을 경우를 처리해준 것 같은데, networkFail는 아니라 noData 등으로 처리해주면 어떨까요?!
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.
구조를 그대로 들고오다보니까 신경쓰지 못했어요!! 다시 확인 후 수정해보겠습니다
if answerCountResponse.status == 200 { | ||
if let count = answerCountResponse.data { | ||
print("채점이 성공했습니다.. 맞은 개수: \(count)") | ||
completion(.success(count)) | ||
} else { | ||
completion(.failure(.networkFail)) | ||
print("응답에서 초대 코드를 찾을 수 없습니다.") | ||
} | ||
} else { | ||
completion(.failure(.networkFail)) | ||
print("질문지 생성 실패: \(answerCountResponse.message)") | ||
} |
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.
위에서 말한 91-94줄의 분기처리가 필요없다면 이 전체를 guard let으로 퉁치면 될 것 같아요
guard answerCountResponse.status == 200,
let count = answerCountResponse.data else {
print("질문지 생성 실패: \(answerCountResponse.message)")
completion(.failure(.networkFail))
return
}
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.
와 천재개발자
} catch { | ||
completion(.failure(.networkFail)) |
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.
이것도 .decodingErr 만들어서 처리해주면 좋을 것 같습니다
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.
수정했어용~
🩵 Issue
close #44
💙 변경된 내용
📘 ScreenShot
수정 필요 사항