Skip to content

Commit

Permalink
🐛 username DTO 필드명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
loinsir committed Dec 6, 2023
1 parent 6b91a38 commit 301cd4d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion iOS/Layover/Layover/Network/DTOs/NicknameDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import Foundation

struct NicknameDTO: Codable {
let userName: String
let username: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class DefaultUserEndPointFactory: UserEndPointFactory {

func makeUserWithDrawEndPoint() -> EndPoint<Response<NicknameDTO>> {
return EndPoint(
path: "/member/withdraw",
path: "/member",
method: .DELETE
)
}
Expand Down
2 changes: 1 addition & 1 deletion iOS/Layover/Layover/Scenes/Login/LoginConfigurator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class LoginConfigurator: Configurator {
let interactor = LoginInteractor()
let presenter = LoginPresenter()
// TODO: 실행 전 Worker Mock인지 확인
let worker = MockLoginWorker()
let worker = LoginWorker()
let router = LoginRouter()

router.viewController = viewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ final class SignUpConfigurator: Configurator {
func configure(_ viewController: SignUpViewController) {
let viewController = viewController
let interactor = SignUpInteractor()
let userWorker = MockUserWorker()
let signUpWorker = MockSignUpWorker()
let userWorker = UserWorker()
let signUpWorker = SignUpWorker()
let presenter = SignUpPresenter()
let router = SignUpRouter()
viewController.interactor = interactor
Expand Down
8 changes: 4 additions & 4 deletions iOS/Layover/Layover/Workers/Mocks/MockUserWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ final class MockUserWorker: UserWorkerProtocol {
}
let endPoint: EndPoint = EndPoint<Response<NicknameDTO>>(path: "/member/username",
method: .PATCH,
bodyParameters: NicknameDTO(userName: nickname))
bodyParameters: NicknameDTO(username: nickname))
let response = try await provider.request(with: endPoint)
guard let data = response.data else { return nil }
return data.userName
return data.username
} catch {
os_log(.error, log: .data, "%@", error.localizedDescription)
return nil
Expand All @@ -67,7 +67,7 @@ final class MockUserWorker: UserWorkerProtocol {
}
let endPoint = EndPoint<Response<CheckUserNameDTO>>(path: "/member/check-username",
method: .POST,
bodyParameters: NicknameDTO(userName: userName))
bodyParameters: NicknameDTO(username: userName))
let response = try await provider.request(with: endPoint, authenticationIfNeeded: false)
return response.data?.isValid
} catch {
Expand Down Expand Up @@ -118,7 +118,7 @@ final class MockUserWorker: UserWorkerProtocol {
method: .DELETE)
let response = try await provider.request(with: endPoint)
guard let data = response.data else { throw NetworkError.emptyData }
return data.userName
return data.username
} catch {
os_log(.error, log: .data, "%@", error.localizedDescription)
return nil
Expand Down
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Workers/UserWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class UserWorker: UserWorkerProtocol {
os_log(.error, log: .default, "Failed to modify nickname with error: %@", responseData.message)
return nil
}
return data.userName
return data.username
} catch {
os_log(.error, log: .default, "Failed to modify nickname with error: %@", error.localizedDescription)
return nil
Expand Down Expand Up @@ -118,7 +118,7 @@ final class UserWorker: UserWorkerProtocol {
os_log(.error, log: .default, "Failed to withdraw with error: %@", responseData.message)
return nil
}
return data.userName
return data.username
} catch {
os_log(.error, log: .default, "Failed to withdraw with error: %@", error.localizedDescription)
return nil
Expand Down

0 comments on commit 301cd4d

Please sign in to comment.