Skip to content

Commit

Permalink
๐Ÿงฉ :: VC, VM ์„ค์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
ray3238 committed Jul 23, 2024
1 parent 3f214bb commit 75c41a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Projects/Presentation/Sources/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public final class HomeViewController: BaseViewController<HomeViewModel> {
navigateToEasterEggDidTap: navigateToEasterEggDidTap,
navigateToCompanyButtonDidTap: findCompanysCard.rx.tap.asSignal(),
rejectButtonDidTap: rejectButtonDidTap,
reApplyButtonDidTap: reApplyButtonDidTap
reApplyButtonDidTap: reApplyButtonDidTap,
applicationStatusTableViewDidTap: applicationStatusTableView.rx
.modelSelected(ApplicationEntity.self)
.asObservable()
.map { ($0.recruitmentID, $0.applicationStatus) }
)

titleImageView.rx.tapGesture().when(.recognized).asObservable()
Expand Down
12 changes: 12 additions & 0 deletions Projects/Presentation/Sources/Home/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public final class HomeViewModel: BaseViewModel, Stepper {
let navigateToCompanyButtonDidTap: Signal<Void>
let rejectButtonDidTap: PublishRelay<ApplicationEntity>
let reApplyButtonDidTap: PublishRelay<ApplicationEntity>
let applicationStatusTableViewDidTap: Observable<(Int, ApplicationStatusType)>
}

public struct Output {
Expand Down Expand Up @@ -125,6 +126,17 @@ public final class HomeViewModel: BaseViewModel, Stepper {
.bind(to: steps)
.disposed(by: disposeBag)

input.applicationStatusTableViewDidTap.asObservable()
.map { id, status in
if status == .pass || status == .fieldTrain {
return HomeStep.recruitmentDetailIsRequired(id: id)
} else {
return HomeStep.none
}
}
.bind(to: steps)
.disposed(by: disposeBag)

return Output(
studentInfo: studentInfo,
applicationList: applicationList,
Expand Down

0 comments on commit 75c41a9

Please sign in to comment.