From d483b59978d504272a0f3416d7bd63c2284a1a27 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 18 Dec 2024 03:27:55 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=AC=EB=A7=A4=EB=AA=A9=EB=A1=9D=20-=20orde?= =?UTF-8?q?rType=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/Content/ContentApi.swift | 10 +++------- SodaLive/Sources/Content/ContentRepository.swift | 4 ++-- .../Playlist/Create/PlaylistAddContentView.swift | 4 ++-- .../MyPage/OrderList/OrderListAllViewModel.swift | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/SodaLive/Sources/Content/ContentApi.swift b/SodaLive/Sources/Content/ContentApi.swift index 962155e..e8f7dc6 100644 --- a/SodaLive/Sources/Content/ContentApi.swift +++ b/SodaLive/Sources/Content/ContentApi.swift @@ -14,7 +14,7 @@ enum ContentApi { case likeContent(request: PutAudioContentLikeRequest) case registerComment(request: RegisterAudioContentCommentRequest) case orderAudioContent(request: OrderRequest) - case getOrderList(orderType: OrderType?, page: Int, size: Int) + case getOrderList(page: Int, size: Int) case addAllPlaybackTracking(request: AddAllPlaybackTrackingRequest) case getAudioContentThemeList case uploadAudioContent(parameters: [MultipartFormData]) @@ -184,16 +184,12 @@ extension ContentApi: TargetType { case .orderAudioContent(let request): return .requestJSONEncodable(request) - case .getOrderList(let orderType, let page, let size): - var parameters = [ + case .getOrderList(let page, let size): + let parameters = [ "page": page - 1, "size": size ] as [String : Any] - if let orderType = orderType { - parameters["orderType"] = orderType - } - return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString) case .addAllPlaybackTracking(let request): diff --git a/SodaLive/Sources/Content/ContentRepository.swift b/SodaLive/Sources/Content/ContentRepository.swift index ed9c622..dd70e6c 100644 --- a/SodaLive/Sources/Content/ContentRepository.swift +++ b/SodaLive/Sources/Content/ContentRepository.swift @@ -34,8 +34,8 @@ final class ContentRepository { return api.requestPublisher(.orderAudioContent(request: OrderRequest(contentId: contentId, orderType: orderType))) } - func getOrderList(orderType: OrderType?, page: Int, size: Int) -> AnyPublisher { - return api.requestPublisher(.getOrderList(orderType: orderType, page: page, size: size)) + func getOrderList(page: Int, size: Int) -> AnyPublisher { + return api.requestPublisher(.getOrderList(page: page, size: size)) } func addAllPlaybackTracking(request: AddAllPlaybackTrackingRequest) -> AnyPublisher { diff --git a/SodaLive/Sources/Content/Playlist/Create/PlaylistAddContentView.swift b/SodaLive/Sources/Content/Playlist/Create/PlaylistAddContentView.swift index 13a6931..f516ddb 100644 --- a/SodaLive/Sources/Content/Playlist/Create/PlaylistAddContentView.swift +++ b/SodaLive/Sources/Content/Playlist/Create/PlaylistAddContentView.swift @@ -83,14 +83,14 @@ struct PlaylistAddContentView: View { .padding(.top, 6.7) .onAppear { if index == viewModel.orderList.count - 1 { - viewModel.getOrderList(orderType: .KEEP) + viewModel.getOrderList() } } } } } .onAppear { - viewModel.getOrderList(orderType: .KEEP) + viewModel.getOrderList() } } .padding(.horizontal, 13.3) diff --git a/SodaLive/Sources/MyPage/OrderList/OrderListAllViewModel.swift b/SodaLive/Sources/MyPage/OrderList/OrderListAllViewModel.swift index 04fc487..8ace5eb 100644 --- a/SodaLive/Sources/MyPage/OrderList/OrderListAllViewModel.swift +++ b/SodaLive/Sources/MyPage/OrderList/OrderListAllViewModel.swift @@ -25,11 +25,11 @@ final class OrderListAllViewModel: ObservableObject { var isLast = false private let pageSize = 10 - func getOrderList(orderType: OrderType? = nil) { + func getOrderList() { if (!isLast && !isLoading) { isLoading = true - repository.getOrderList(orderType: orderType, page: page, size: pageSize) + repository.getOrderList(page: page, size: pageSize) .sink { result in switch result { case .finished: