-
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] Task 리스트 조회 api 연결 #169
Conversation
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.
수고하셨습니다! 깔끔하게 잘 짜주신 것 같아서 뜯어보고 이해하고 배우는 데 계속 좋은 참고가 될 것 같습니다.. ㅎ 수고 많으셨습니다!
/** Task 리스트 조회 */ | ||
const useGetTasks = ({ isTotal, sortOrder, targetDate }: GetTasksType) => | ||
useQuery({ | ||
queryKey: ['today', isTotal, sortOrder, targetDate], | ||
queryFn: () => getTasks({ isTotal, sortOrder, targetDate }), | ||
}); |
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.
요런 식으로 리액트 쿼리를 사용하는 거군요,, 처음 써보기에 좀 막막한데요오 먼저 잘 정리해주셔서 잘 참고할 수 있을 것 같습니다!
쿼리키에 today를 추가해주신 이유는 무엇인가요? 오늘 날짜를 기준으로 순서를 sort 하기 위함인가용?-?
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.
today 페이지에서 사용해서 페이지별로 구분하면 이해하기 빠를 것 같아서 앞에 써주었습니다! 소팅하는 건 getTasks로 전달하는 요소들 중 두번째에서 담당하고 있어요!
const { data } = await privateInstance.get('/api/tasks', { | ||
params: { | ||
isTotal, | ||
order: sortOrder, |
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.
요건 걍 궁금한건데 order는 왜 sortOrder로 한번 더 명명해준건가용??
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.
state 이름을 order로 지으면 구분하기가 다소 모호한데 서버에서 요구하는 path variable 에서는 order로 명명되어 있어서 한번 바꿔서 전달해줬습니다!
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.
구글로그인 되는 것 + task 리스트 받아오는 것 확인했습니다!! 👍 👍 stale tiem이랑 gc time 1분 적당한 것 같습니다!
localStorage에 토큰이 들어가지 않는 이슈에서 출발해 토큰 형식을 고쳤는데도 작동하지 않아 navigate 가 원인임을 발견했습니다
근데 요건 어떤 문제였나요??
CLOSEST: '지연된 할 일', | ||
CLOSEST: '가까운 마감기한순', |
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.
😂
// const dummyTaskList: TaskType[] = [ | ||
// { | ||
// id: 3, | ||
// name: '김지원', | ||
// deadLine: { | ||
// date: '2024-06-30', | ||
// time: '12:30', | ||
// }, | ||
// hasDescription: true, | ||
// status: '미완료', | ||
// }, | ||
// ]; |
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.
엇...???!!! 지워주세요~~
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.
지웠어용
e623d73
to
050593f
Compare
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.
덕분에 api 작업을 편하게 할 것 같습니다 감사합니다!!
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.
구글 버튼을 따로 분리해주셨군요! 해당 파일을 분리하는 게 더 보기 좋아보이네요 감사합니다!
import { Navigate, Outlet } from 'react-router-dom'; | ||
|
||
function PrivateRoute() { | ||
const isAuthenticated = localStorage.getItem('accessToken'); |
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.
해당 부분은 나중에 맞는 accesstoken인지 교차검증을 하는 과정을 추가하도록 하겠씁니다!
작업 내용 🧑💻
알게된 점 🚀
리뷰 요구사항 💬
관련 이슈
close #165
스크린샷 (선택)