-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Pokit Flow API Connect #81
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
755d9bf
[fix] 닉네임 텍스트필드 입력간 비활성 처리 추가
stealmh 8339298
[chore] 페이지 쿼리 구조체 Equatable 추가
stealmh dd9f785
[chore] #76 포킷검색 api 접근제어자 및 필터링 추가
stealmh 67934b1
[feat] 닉네임 할당 누락 추가
stealmh 6ab6b3c
[feat] #76 카테고리 메인 조회 api 연결
stealmh a21eddb
[feat] #76 Body가 없을 때 요청 함수 추가
stealmh a51f55b
[chore] #76 삭제 / 수정 id 필드값 수정
stealmh 97808d5
[feat] #76 정렬 기능 inner action 이동 및 카테고리 삭제 API 연결
stealmh f99ddff
[chore] 미사용 return 제거
stealmh 485195c
[feat] #76 포킷 API 연결
stealmh 490d7b3
[feat] #76 포킷 추가 및 수정 시 내 포킷(카테고리)목록 API 연결
stealmh a66701b
[feat] #76 카테고리 상세 화면 API 연결
stealmh 2d6a29b
Merge branch 'develop' into feat/#76-pokit-api
ShapeKim98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ public struct CategoryDetailFeature { | |
/// - Dependency | ||
@Dependency(\.dismiss) var dismiss | ||
@Dependency(\.pasteboard) var pasteboard | ||
@Dependency(\.categoryClient) var categoryClient | ||
/// - State | ||
@ObservableState | ||
public struct State: Equatable { | ||
|
@@ -78,6 +79,7 @@ public struct CategoryDetailFeature { | |
case pokitCategorySheetPresented(Bool) | ||
case pokitCategorySelectSheetPresented(Bool) | ||
case pokitDeleteSheetPresented(Bool) | ||
case 카테고리_목록_조회_결과(BaseCategoryListInquiry) | ||
} | ||
|
||
public enum AsyncAction: Equatable { case doNothing } | ||
|
@@ -149,7 +151,8 @@ private extension CategoryDetailFeature { | |
return .send(.inner(.pokitCategorySelectSheetPresented(true))) | ||
|
||
case .categorySelected(let item): | ||
/// Todo: 아이템 선택한 것 반영 | ||
state.domain.category = item | ||
//TODO: 현재 아이템 값을 통해 카테고리 내 컨텐츠 리스트들을 뿌려줘야 함 | ||
return .send(.inner(.pokitCategorySelectSheetPresented(false))) | ||
|
||
case .filterButtonTapped: | ||
|
@@ -164,9 +167,13 @@ private extension CategoryDetailFeature { | |
|
||
case .onAppear: | ||
// - MARK: 목업 데이터 조회 | ||
state.domain.categoryListInQuiry = CategoryListInquiryResponse.mock.toDomain() | ||
state.domain.contentList = ContentListInquiryResponse.mock.toDomain() | ||
// state.domain.categoryListInQuiry = CategoryListInquiryResponse.mock.toDomain() | ||
// state.domain.contentList = ContentListInquiryResponse.mock.toDomain() | ||
return .run { send in | ||
let request = BasePageableRequest(page: 0, size: 100, sort: ["desc"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. size를 100으로 한 이유가 있나요?(페이징 처음이라 몰라서 물어보는것) |
||
let response = try await categoryClient.카테고리_목록_조회(request, true).toDomain() | ||
await send(.inner(.카테고리_목록_조회_결과(response))) | ||
|
||
for await _ in self.pasteboard.changes() { | ||
let url = try await pasteboard.probableWebURL() | ||
await send(.delegate(.linkCopyDetected(url)), animation: .pokitSpring) | ||
|
@@ -189,6 +196,14 @@ private extension CategoryDetailFeature { | |
case let .pokitCategorySelectSheetPresented(presented): | ||
state.isCategorySelectSheetPresented = presented | ||
return .none | ||
|
||
case let .카테고리_목록_조회_결과(response): | ||
state.domain.categoryListInQuiry = response | ||
guard let first = response.data.first(where: { item in | ||
item.id == state.domain.category.id | ||
}) else { return .none } | ||
state.domain.category = first | ||
return .none | ||
} | ||
} | ||
|
||
|
@@ -262,7 +277,11 @@ private extension CategoryDetailFeature { | |
case .포킷삭제: | ||
state.isPokitDeleteSheetPresented = false | ||
state.kebobSelectedType = nil | ||
return .send(.delegate(.포킷삭제)) | ||
return .run { [categoryId = state.domain.category.id] send in | ||
await send(.inner(.pokitDeleteSheetPresented(false))) | ||
await send(.delegate(.포킷삭제)) | ||
try await categoryClient.카테고리_삭제(categoryId) | ||
} | ||
} | ||
} | ||
/// - 필터 버튼을 눌렀을 때 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이건 이제 지워도 될것 같아요