Skip to content

Commit

Permalink
fix: miss body
Browse files Browse the repository at this point in the history
  • Loading branch information
akrudal committed Dec 16, 2024
1 parent f076834 commit 806933e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public final class ProfileViewController: BaseViewController<ProfileViewReactor>
}

// 기본 이미지가 true 이고 닉네임 변경 할 경우 redraw
extension ProfileViewController {
extension ProfileViewController {
private func setupProfileImage(url: URL) {
let processor = DownsamplingImageProcessor(size: profileView.bounds.size)

Expand Down Expand Up @@ -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))
}

}
Expand Down
9 changes: 5 additions & 4 deletions 14th-team5-iOS/Data/Sources/APIs/Me/MeAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Core
// TODO: MeAPIs로 이름 바꾸기 - Trash 지워야 함
enum MeAPI: BBAPI {
/// 가족 가입하기
case joinFamily
case joinFamily(_ body: JoinFamilyRequestDTO)
/// 가족 탈퇴하기
case resignFamily
/// 가족 생성 및 가족 정보 조회
Expand All @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion 14th-team5-iOS/Data/Sources/APIs/Me/MeeAPIWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension MeeAPIWorker {
func joinFamily(
body: JoinFamilyRequestDTO
) -> Observable<JoinFamilyResponseDTO?> {
let spec = MeAPI.joinFamily.spec
let spec = MeAPI.joinFamily(body).spec

return request(spec)
}
Expand Down

0 comments on commit 806933e

Please sign in to comment.