From 5f4eba058d84431d166ff11a9c2bd1fe8787ccdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:59:04 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20#129=20ContentDetailFeature=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=EB=B0=98=ED=99=98=20=ED=95=B8=EB=93=A4?= =?UTF-8?q?=EB=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContentDetail/ContentDetailFeature.swift | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/Projects/Feature/FeatureContentDetail/Sources/ContentDetail/ContentDetailFeature.swift b/Projects/Feature/FeatureContentDetail/Sources/ContentDetail/ContentDetailFeature.swift index bd7762df..7c5c80a8 100644 --- a/Projects/Feature/FeatureContentDetail/Sources/ContentDetail/ContentDetailFeature.swift +++ b/Projects/Feature/FeatureContentDetail/Sources/ContentDetail/ContentDetailFeature.swift @@ -141,17 +141,13 @@ private extension ContentDetailFeature { guard let id = state.domain.contentId else { return .none } - return .run { send in - await send(.async(.컨텐츠_상세_조회_API(id: id))) - } + return .send(.async(.컨텐츠_상세_조회_API(id: id))) case .공유_버튼_눌렀을때: state.showShareSheet = true return .none case .수정_버튼_눌렀을때: guard let content = state.domain.content else { return .none } - return .run { [content] send in - await send(.delegate(.editButtonTapped(contentId: content.id))) - } + return .send(.delegate(.editButtonTapped(contentId: content.id))) case .삭제_버튼_눌렀을때: state.showAlert = true return .none @@ -159,9 +155,7 @@ private extension ContentDetailFeature { guard let id = state.domain.contentId else { return .none } - return .run { send in - await send(.async(.컨텐츠_삭제_API(id: id))) - } + return .send(.async(.컨텐츠_삭제_API(id: id))) case .binding: return .none case .즐겨찾기_버튼_눌렀을때: @@ -169,12 +163,10 @@ private extension ContentDetailFeature { let favorites = state.domain.content?.favorites else { return .none } - return .run { send in - if favorites { - await send(.async(.즐겨찾기_취소_API(id: content.id))) - } else { - await send(.async(.즐겨찾기_API(id: content.id))) - } + if favorites { + return .send(.async(.즐겨찾기_취소_API(id: content.id))) + } else { + return .send(.async(.즐겨찾기_API(id: content.id))) } case .링크_공유_완료되었을때: state.showShareSheet = false @@ -215,10 +207,10 @@ private extension ContentDetailFeature { return .send(.inner(.메타데이터_조회_수행(url: url)), animation: .pokitDissolve) case .컨텐츠_상세_조회_API_반영(content: let content): state.domain.content = content - return .run { send in - await send(.delegate(.컨텐츠_조회_완료)) - await send(.inner(.URL_유효성_확인)) - } + return .merge( + .send(.delegate(.컨텐츠_삭제_완료)), + .send(.inner(.URL_유효성_확인)) + ) case .즐겨찾기_API_반영(let favorite): state.domain.content?.favorites = favorite return .send(.delegate(.즐겨찾기_갱신_완료))