Skip to content

Commit 75c41a9

Browse files
committed
๐Ÿงฉ :: VC, VM ์„ค์ •
1 parent 3f214bb commit 75c41a9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

โ€ŽProjects/Presentation/Sources/Home/HomeViewController.swiftโ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ public final class HomeViewController: BaseViewController<HomeViewModel> {
113113
navigateToEasterEggDidTap: navigateToEasterEggDidTap,
114114
navigateToCompanyButtonDidTap: findCompanysCard.rx.tap.asSignal(),
115115
rejectButtonDidTap: rejectButtonDidTap,
116-
reApplyButtonDidTap: reApplyButtonDidTap
116+
reApplyButtonDidTap: reApplyButtonDidTap,
117+
applicationStatusTableViewDidTap: applicationStatusTableView.rx
118+
.modelSelected(ApplicationEntity.self)
119+
.asObservable()
120+
.map { ($0.recruitmentID, $0.applicationStatus) }
117121
)
118122

119123
titleImageView.rx.tapGesture().when(.recognized).asObservable()

โ€ŽProjects/Presentation/Sources/Home/HomeViewModel.swiftโ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public final class HomeViewModel: BaseViewModel, Stepper {
3232
let navigateToCompanyButtonDidTap: Signal<Void>
3333
let rejectButtonDidTap: PublishRelay<ApplicationEntity>
3434
let reApplyButtonDidTap: PublishRelay<ApplicationEntity>
35+
let applicationStatusTableViewDidTap: Observable<(Int, ApplicationStatusType)>
3536
}
3637

3738
public struct Output {
@@ -125,6 +126,17 @@ public final class HomeViewModel: BaseViewModel, Stepper {
125126
.bind(to: steps)
126127
.disposed(by: disposeBag)
127128

129+
input.applicationStatusTableViewDidTap.asObservable()
130+
.map { id, status in
131+
if status == .pass || status == .fieldTrain {
132+
return HomeStep.recruitmentDetailIsRequired(id: id)
133+
} else {
134+
return HomeStep.none
135+
}
136+
}
137+
.bind(to: steps)
138+
.disposed(by: disposeBag)
139+
128140
return Output(
129141
studentInfo: studentInfo,
130142
applicationList: applicationList,

0 commit comments

Comments
ย (0)