Skip to content

Commit

Permalink
[IDLE-90] 요양보호사는 회원가입시 토큰을 돌려받도록 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
J0onYEong committed Jul 25, 2024
1 parent efe6fd8 commit b103cb3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public extension DefaultAuthRepository {
// MARK: Worker auth
public extension DefaultAuthRepository {

/// 요양보호사의 경우 회원가입시 곧바로 토큰을 발급받습니다.
func requestRegisterWorkerAccount(registerState: WorkerRegisterState) -> Single<Void> {
let dto = WorkerRegistrationDTO(
carerName: registerState.name,
Expand All @@ -66,8 +67,8 @@ public extension DefaultAuthRepository {

let data = (try? JSONEncoder().encode(dto)) ?? Data()

return networkService.request(api: .registerWorkerAccount(data: data), with: .plain)
.map { _ in return () }
return networkService.requestDecodable(api: .registerWorkerAccount(data: data), with: .plain)
.flatMap { [unowned self] in saveTokenToStore(token: $0) }
}

func requestWorkerLogin(phoneNumber: String, authNumber: String) -> Single<Void> {
Expand Down

0 comments on commit b103cb3

Please sign in to comment.