-
Notifications
You must be signed in to change notification settings - Fork 2
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
공통, 쿼리 커스텀 훅 작성 및 기타 수정 #85
Conversation
bfa8392
to
9d09594
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.
https://preview.dailyroad.site/map
api 경로가 좀 이상해요
env 파일 시크릿 확인해 주세요!
<Route path="/create" element={<MapPage />} /> | ||
<Route path="/create/map" element={<MapCreateMapPage />} /> | ||
<Route path="/create/course" element={<MapCreateCoursePage />} /> | ||
<Route path="/create/map/:mapId" element={<PlaceCreatePage />} /> |
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.
q. 본인 소유의 지도가 아닌데 이 경로로 접근하면 어떻게 되나요?
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.
크흠 아직 그부분의 로직이 없습니다.. 그냥 주소창에 mapId를 적어도 누구나 접근이 가능합니다.
className="w-full rounded border px-3 py-2" | ||
required | ||
onChange={(prev) => updateMapInfo('title', prev)} | ||
placeholder={'새 지도명을 입력해주세요.'} |
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.
p3. 여긴 모드에 따라 안변하나요? 지도 or 코스로
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.
생성폼과 거의 유사해서 이후에 수정폼을 만들 때 더 다듬어 봐야겠어요.
<Box> | ||
<button | ||
className={`h-14 w-full rounded-md ${activePlace ? 'bg-c_bg_blue' : 'bg-c_button_gray'} p-4 text-xl font-semibold text-white`} | ||
disabled={!!!activePlace} |
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.
q. 3개로 작성하신 이유가 있나요?
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.
3개가 어떤 걸 말씀하시는거죠..?
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.
와 그러네요? ??
이거랑 헷갈렸네요
null 이면 true로 바꿔주고 싶었는데.. 수정하겠습니다
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.
고생하셨습니다!
return data; | ||
}; | ||
|
||
export const getCourseList = async () => { | ||
const { data } = await axiosInstance.get<MapListResponse>(END_POINTS.COURSES); | ||
const { data } = await axiosInstance.get<MapList>(END_POINTS.COURSES); |
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.
p1: MapList
가 아니라 CourseList
가 들어가야 될 것 같아요
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.
넵넵 수정하겠습니다..
if (mode === 'MAP') { | ||
return navigate('/create/map'); | ||
} else { | ||
return navigate('/create/course'); | ||
} |
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.
p2: else
를 없앨 수 있을 것 같네요
if (mode === 'MAP') { | |
return navigate('/create/map'); | |
} else { | |
return navigate('/create/course'); | |
} | |
if (mode === 'MAP') { | |
return navigate('/create/map'); | |
} | |
return navigate('/create/course'); |
const { data: mapListData } = useQuery<MapList, Error>({ | ||
queryKey: ['mapList'], | ||
queryFn: () => getMapList(), | ||
staleTime: 1000 * 60 * 5, |
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.
q: staleTime
은 어떤 시간인가요?
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.
캐시 데이터가 신선함을 나타내는 시간입니다.
5분이 지나면 같은 queryKey에 대해 새롭게 api 요청을 보내게 되고
그 전에는 캐시된 데이터를 사용합니다.
#preview
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.
수고 많았습니다!!!
query: query, | ||
queryFn: ({ pageParam }) => getPlace(query, pageParam), | ||
getNextPageParam: (lastPage) => { | ||
return lastPage.length > 4 ? lastPage.length : undefined; |
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.
q: 4의 의미가 뭔지 모르겠어요.. 상수라면 따로 빼는게 좋지 않을까요...?
📄 Summary
🙋🏻 More
아직 이슈 관련해서 완료된 것은 없어서 열어만 두겠습니다.
🕰️ Actual Time of Completion
close #27
closes #18 #97