-
Notifications
You must be signed in to change notification settings - Fork 13
[조형민] sprint11 #64
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
base: next-조형민
Are you sure you want to change the base?
[조형민] sprint11 #64
The head ref may contain hidden characters: "next-\uC870\uD615\uBBFC-sprint11"
Conversation
- 기존: AuthContext에서 요청/관리 - 변경: user정보가 필요한 곳에서 useQuery로 요청
| function errorHandler(error: any) { | ||
| console.log('AxiosError', error); | ||
| if (error.response) { | ||
| if (axios.isAxiosError(error && error.response)) { |
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.
error.response 넣지 않고 error 만 넣어도 isAxiosError 를 통해 axios error 인지 체크 가능합니다!
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 { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; | ||
| import { useParams, useRouter } from 'next/navigation'; | ||
| import { useEffect, useState } from 'react'; | ||
| import api from '../../../../../../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.
절대 경로 설정을 해주시면 복잡한 상대경로를 해결하실 수 있습니다!
tsconfig.json 에서 baseUrl 을 지정하는 방법을 한 번 확인해 주세요!
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.
앗 tsconfig에 path를 적용했는데 이 부분만 수정이 누락된 것 같습니다!
수정하겠습니다!
| productId?: string | undefined; | ||
| } | ||
|
|
||
| function CommentList({ articleId, productId }: Props) { |
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.
id를 단일로 받고 type정보를 추가로 받아 분기하는 방법도 괜찮아 보입니다!
그렇게되면 Id는 필수로 들어오게 되고 type으로만 어떤 api에 요청하여 데이터를 불러올 지 정해주면 되기 때문에 id 존재여부에 대한 분기 로직이 사라지게 됩니다!
어떤 방법이 효율적인지 한번 더 고려해주세요!
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.
오 이해했습니다. 그게 더 간결할 것 같습니다. 감사합니다!!
|
안녕하세요 형민님! 전반적으로 타입스크립트 적용은 잘 해주셨습니다! 리뷰 남겨드린 부분만 한번 더 확인 해주시고 추가로 궁금한 사항 있으면 질문 부탁드릴게요! |

요구사항
기본 요구사항
공통
프론트엔드
백엔드
멘토에게