@@ -62,7 +62,8 @@ public struct ContentSettingFeature {
6262 var linkTextInputState : PokitInputStyle . State = . default
6363 var titleTextInpuState : PokitInputStyle . State = . default
6464 var memoTextAreaState : PokitInputStyle . State = . default
65- @Shared ( . inMemory( " SelectCategory " ) ) var selectedPokit : BaseCategoryItem ?
65+ @Shared ( . inMemory( " SelectCategory " ) ) var categoryId : Int ?
66+ var selectedPokit : BaseCategoryItem ?
6667 var linkTitle : String ? = nil
6768 var linkImageURL : String ? = nil
6869 var showMaxCategoryPopup : Bool = false
@@ -112,7 +113,7 @@ public struct ContentSettingFeature {
112113
113114 public enum AsyncAction : Equatable {
114115 case 컨텐츠_상세_조회( id: Int )
115- case 카테고리_상세_조회( id: Int )
116+ case 카테고리_상세_조회( id: Int ? , sharedId : Int ? )
116117 case 카테고리_목록_조회
117118 case 컨텐츠_수정
118119 case 컨텐츠_추가
@@ -269,9 +270,12 @@ private extension ContentSettingFeature {
269270 state. domain. memo = content. memo
270271 state. domain. alertYn = content. alertYn
271272 state. contentLoading = false
272- return . run { [ id = content. category. categoryId] send in
273+ return . run { [
274+ id = content. category. categoryId,
275+ sharedCategoryId = state. categoryId
276+ ] send in
273277 await send ( . inner( . parsingURL) )
274- await send ( . async( . 카테고리_상세_조회( id: id) ) )
278+ await send ( . async( . 카테고리_상세_조회( id: id, sharedId : sharedCategoryId ) ) )
275279 }
276280 case . 카테고리_갱신( category: let category) :
277281 state. selectedPokit = BaseCategoryItem (
@@ -327,13 +331,23 @@ private extension ContentSettingFeature {
327331 let content = try await contentClient. 컨텐츠_상세_조회 ( " \( id) " ) . toDomain ( )
328332 await send ( . inner( . 컨텐츠_갱신( content: content) ) )
329333 }
330- case . 카테고리_상세_조회( id: let id) :
331- return . run { [ id] send in
332- let category = try await categoryClient. 카테고리_상세_조회 ( " \( id) " ) . toDomain ( )
333- await send ( . inner( . 카테고리_갱신( category: category) ) )
334+ case let . 카테고리_상세_조회( id, sharedId) :
335+ return . run { send in
336+ if let sharedId {
337+ let category = try await categoryClient. 카테고리_상세_조회 ( " \( sharedId) " ) . toDomain ( )
338+ await send ( . inner( . 카테고리_갱신( category: category) ) )
339+ } else if let id {
340+ let category = try await categoryClient. 카테고리_상세_조회 ( " \( id) " ) . toDomain ( )
341+ await send ( . inner( . 카테고리_갱신( category: category) ) )
342+ }
343+
334344 }
335345 case . 카테고리_목록_조회:
336- return . run { [ pageable = state. domain. pageable] send in
346+ return . run { [
347+ pageable = state. domain. pageable,
348+ id = state. domain. categoryId,
349+ sharedId = state. categoryId
350+ ] send in
337351 let categoryList = try await categoryClient. 카테고리_목록_조회 (
338352 BasePageableRequest (
339353 page: pageable. page,
@@ -342,6 +356,8 @@ private extension ContentSettingFeature {
342356 ) ,
343357 false
344358 ) . toDomain ( )
359+
360+ await send ( . async( . 카테고리_상세_조회( id: id, sharedId: sharedId) ) )
345361 await send ( . inner( . 카테고리_목록_갱신( categoryList: categoryList) ) , animation: . pokitDissolve)
346362 }
347363 case . 컨텐츠_수정:
0 commit comments