Skip to content

Commit

Permalink
✨[FEAT] 로그인 API 연결 완료(#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoonAh-dev committed Feb 18, 2022
1 parent 23146b0 commit 35f3c6d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 21 additions & 0 deletions Umpah-iOS/Umpah-iOS/Network/Storage/LoginStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,25 @@ final class LoginStorage {
}
}
}

// MARK: - POST /auth/signin
func dispatchLogin(phone: String,
completion: @escaping (() -> ())) {
let param = LoginRequest(phone: "01012345678")

self.authProvider.request(.login(param)) { response in
switch response{
case .success(let result):
do{
print(result)
completion()
}catch(let err){
print(err.localizedDescription)
}
case .failure(let err):
print(err.localizedDescription)
print("와 실패다!")
}
}
}
}
4 changes: 0 additions & 4 deletions Umpah-iOS/Umpah-iOS/Screen/Main/Controller/MainVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ final class MainVC: MainTableVC {
// self?.baseTableView.reloadData()
// print("reload 성공")
// }
let loginStorage = LoginStorage.shared
loginStorage.dispatchSignUp(nickname: "", phone: "") {
print("와우 회원가입 완료")
}
}

override func viewDidAppear(_ animated: Bool) {
Expand Down

0 comments on commit 35f3c6d

Please sign in to comment.