-
Notifications
You must be signed in to change notification settings - Fork 35
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
Show topic lessons #332
Show topic lessons #332
Conversation
import PromiseKit | ||
|
||
final class EnrollmentServiceImpl: EnrollmentService { | ||
private enum EnrollmentServiceError: Error { |
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.
Из-за приватности нельзя будет проверить, что ошибка принадлежит к EnrollmentServiceError
.
self.enrollmentsAPI.joinCourse(course).done { | ||
seal.fulfill(course) | ||
}.catch { _ in | ||
seal.reject(EnrollmentServiceError.joinCourseFailed) |
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.
Если мы где-то явно не проверяем, что за ошибка произошла при записи на курс, имеет смысл записать тело как return self.enrollmentsAPI.joinCourse(course)
// MARK: - Private API | ||
|
||
private func joinCoursesIfNeeded() { | ||
guard !coursesIds.isEmpty else { 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.
Чтобы guard не сливался с остальным кодом, предлагаю форматировать его как всё остальное (не в одну строку) и отделять пустой строкой после.
Задача: #APPS-1974
Описание:
Разбил основную задачу на 2 части. Добавил возможность просматривать список уроков для каждого топика.
В следующем PR будут степы (просмотр теории).