From 8ffe786f9fba353b8a4ae1187f8f710b1b702bee Mon Sep 17 00:00:00 2001 From: Sejin Lee Date: Mon, 26 Dec 2022 16:32:19 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#57=20-=20Domain=20Layer=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20=EB=B0=8F=20VC=EC=99=80=20=EB=B0=94=EC=9D=B8?= =?UTF-8?q?=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domain/Sources/UseCase/PasswordChangeUseCase.swift | 7 ++++++- .../PasswordSettingScene/VC/PasswordChangeVC.swift | 1 - .../ViewModel/PasswordChangeViewModel.swift | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/SOPT-Stamp-iOS/Projects/Domain/Sources/UseCase/PasswordChangeUseCase.swift b/SOPT-Stamp-iOS/Projects/Domain/Sources/UseCase/PasswordChangeUseCase.swift index 51101f7f7..189890359 100644 --- a/SOPT-Stamp-iOS/Projects/Domain/Sources/UseCase/PasswordChangeUseCase.swift +++ b/SOPT-Stamp-iOS/Projects/Domain/Sources/UseCase/PasswordChangeUseCase.swift @@ -48,7 +48,12 @@ extension DefaultPasswordChangeUseCase: PasswordChangeUseCase { } public func changePassword(password: String) { - // repository 연결 + repository.changePassword(password: password) + .sink { event in + print("PasswordChangeUseCase: \(event)") + } receiveValue: { isSuccess in + self.passwordChangeSuccess.send(isSuccess) + }.store(in: cancelBag) } } diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/VC/PasswordChangeVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/VC/PasswordChangeVC.swift index ac2e6a4af..786056cd9 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/VC/PasswordChangeVC.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/VC/PasswordChangeVC.swift @@ -92,7 +92,6 @@ extension PasswordChangeVC { print(isSuccess) }.store(in: cancelBag) } - } // MARK: - UI & Layout diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/ViewModel/PasswordChangeViewModel.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/ViewModel/PasswordChangeViewModel.swift index a1ff9cb45..359e4aba6 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/ViewModel/PasswordChangeViewModel.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SettingScene/PasswordSettingScene/ViewModel/PasswordChangeViewModel.swift @@ -61,8 +61,8 @@ extension PasswordChangeViewModel { }.store(in: self.cancelBag) input.passwordChangeButtonTapped - .sink { signUpRequest in - // 버튼 클릭 액션 + .sink { password in + self.useCase.changePassword(password: password) }.store(in: self.cancelBag) return output @@ -88,5 +88,11 @@ extension PasswordChangeViewModel { } receiveValue: { isValidForm in output.isValidForm.send(isValidForm) }.store(in: cancelBag) + + useCase.passwordChangeSuccess.sink { event in + print("PasswordChangeViewModel - completion: \(event)") + } receiveValue: { isSuccess in + output.passwordChangeSuccessed.send(isSuccess) + }.store(in: cancelBag) } }