Skip to content
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

[Refactor] main page 탠스택 쿼리 적용 #338

Open
4 tasks done
ienrum opened this issue Apr 10, 2024 · 0 comments
Open
4 tasks done

[Refactor] main page 탠스택 쿼리 적용 #338

ienrum opened this issue Apr 10, 2024 · 0 comments
Assignees
Labels

Comments

@ienrum
Copy link
Collaborator

ienrum commented Apr 10, 2024

Description

메인페이지서 get 요청되는 것을 tanstack query 로 수정합니다.
search posts api 는 모든 posts 를 불러올수밖에 없어 useQuery 로 작성합니다.

메인 페이지의 PostList 컴포넌트의 책임이 너무 큰것같아, 분리 합니다.

✅Todo

  • fetch all posts (useInfiniteQuery)
  • fetch channel posts (useInfiniteQuery)
  • fetch search posts (useQuery)
  • 라우터로 PostList 컴포넌트 분리

Reference

@ienrum ienrum self-assigned this Apr 10, 2024
HoberMin pushed a commit that referenced this issue Jun 1, 2024
* chore: @rollup/rollup-win32-x64-msvc missing 버그로 인해 해당 의존성 추가

* refactor: 사용하지 않는 status slice 와 customAxios 의 status slice 제거

- 순환 참조 문제 해결

* refactor: router 분리

* feat: fetch post list api 정의

* feat: tanstack query 작성

* refactor: PostList 컴포넌트 분리

* refactor: content header fetching 로직 제거

* fix: type error 수정

* Refactor: axios retry 로직을 App.tsx 으로 이동

* Refactor: import Type 구문으로 수정  getChannel.ts, getChannels.ts, getPosts.ts

* Fix: channelName 체크 in ContentHeader component

* Refactor: useFetchSearchPosts search 파라미터 직접 전달

* Refactor: PostList 컴포넌트 response props 에 spread 연산자 사용

* Refactor: useFetchAllOfPosts, useFetchChannelPosts, useFetchSearchPosts hooks 에서 keepPreviousData 삭제
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant