-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX/#178] PlaylistView 오류 해결 #179
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: Junu-Pak <[email protected]> Co-authored-by: WooFeather <[email protected]>
Co-authored-by: Junu-Pak <[email protected]> Co-authored-by: WooFeather <[email protected]>
/// 플레이리스트를 업데이트합니다. 이미지URL을 받습니다. | ||
func updatePlaylist(playlistId: Int, title: String, imageUrl: String?) async -> Result<Void, any Error> { | ||
|
||
let request = UpdatePlaylistRequest(title: title, playlistImageUrl: imageUrl ?? "") | ||
let response = await playlistRepository.updatePlaylist(request: request, playlistId: Int64(playlistId)) | ||
switch response { | ||
case .success: | ||
return .success(()) | ||
case .failure(let error): | ||
return .failure(error) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원래의 UIImage?
타입을 받는 함수에서는 기본 이미지(url)을 저장해놓을수 없어서
imageUrl
즉, String?
타입을 받는 함수를 별도로 만들었습니다.
if let selectedImg = selectedImage { | ||
await playlistUseCase.updatePlaylist( | ||
playlistId: Int(selectedPlaylist.id), | ||
title: selectedPlaylist.title, | ||
image: selectedImage | ||
) | ||
} else { | ||
await playlistUseCase.updatePlaylist(playlistId: Int(selectedPlaylist.id), title: selectedPlaylist.title, imageUrl: selectedPlaylist.imageUrl) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
플레이리스트 편집을 할 때 이미지를 변경한 경우 selectedImage를 전달해주고,
이미 설정해놓은 이미지가 있는 상태에서 변경없이 완료를 누른 경우 원래 설정되어있던 imageUrl을 전달합니다.
close #178
⛳️ Work Description
📸 Screenshot
📢 To Reviewers
✅ Checklist