diff --git a/14th-team5-iOS/App/Sources/Presentation/Profile/ProfileViewController.swift b/14th-team5-iOS/App/Sources/Presentation/Profile/ProfileViewController.swift index d7e1bb4f..a37b1af0 100644 --- a/14th-team5-iOS/App/Sources/Presentation/Profile/ProfileViewController.swift +++ b/14th-team5-iOS/App/Sources/Presentation/Profile/ProfileViewController.swift @@ -263,7 +263,7 @@ public final class ProfileViewController: BaseViewController } // 기본 이미지가 true 이고 닉네임 변경 할 경우 redraw -extension ProfileViewController { +extension ProfileViewController { private func setupProfileImage(url: URL) { let processor = DownsamplingImageProcessor(size: profileView.bounds.size) @@ -324,10 +324,11 @@ extension ProfileViewController: PHPickerViewControllerDelegate { picker.dismiss(animated: true, completion: nil) if let imageProvider = itemProvider, imageProvider.canLoadObject(ofClass: UIImage.self) { - imageProvider.loadObject(ofClass: UIImage.self) { image, error in - guard let photoImage: UIImage = image as? UIImage, + imageProvider.loadObject(ofClass: UIImage.self) { [weak self] image, error in + guard let self = self, + let photoImage: UIImage = image as? UIImage, let originalData: Data = photoImage.jpegData(compressionQuality: 1.0) else { return } - imageProvider.didSelectProfileImageWithProcessing(photo: originalData, error: error) + self.reactor?.action.onNext(.didSelectPHAssetsImage(originalData)) } } diff --git a/14th-team5-iOS/Data/Sources/APIs/Me/MeAPI.swift b/14th-team5-iOS/Data/Sources/APIs/Me/MeAPI.swift index 60964322..f73c8324 100644 --- a/14th-team5-iOS/Data/Sources/APIs/Me/MeAPI.swift +++ b/14th-team5-iOS/Data/Sources/APIs/Me/MeAPI.swift @@ -10,7 +10,7 @@ import Core // TODO: MeAPIs로 이름 바꾸기 - Trash 지워야 함 enum MeAPI: BBAPI { /// 가족 가입하기 - case joinFamily + case joinFamily(_ body: JoinFamilyRequestDTO) /// 가족 탈퇴하기 case resignFamily /// 가족 생성 및 가족 정보 조회 @@ -26,13 +26,14 @@ enum MeAPI: BBAPI { var spec: Spec { switch self { - case .joinFamily: + case let .joinFamily(body): return .init( method: .post, - path: "/me/join-family" + path: "/me/join-family", + bodyParametersEncodable: body ) case .resignFamily: - return .init( + return .init( method: .post, path: "/me/quit-family" ) diff --git a/14th-team5-iOS/Data/Sources/APIs/Me/MeeAPIWorker.swift b/14th-team5-iOS/Data/Sources/APIs/Me/MeeAPIWorker.swift index f6391149..aef73469 100644 --- a/14th-team5-iOS/Data/Sources/APIs/Me/MeeAPIWorker.swift +++ b/14th-team5-iOS/Data/Sources/APIs/Me/MeeAPIWorker.swift @@ -37,7 +37,7 @@ extension MeeAPIWorker { func joinFamily( body: JoinFamilyRequestDTO ) -> Observable { - let spec = MeAPI.joinFamily.spec + let spec = MeAPI.joinFamily(body).spec return request(spec) }