[조형민] sprint11#64
Open
paengdal wants to merge 5 commits intocodeit-sprint-fullstack:next-조형민from
Hidden character warning
The head ref may contain hidden characters: "next-\uc870\ud615\ubbfc-sprint11"
Open
Conversation
- 기존: AuthContext에서 요청/관리 - 변경: user정보가 필요한 곳에서 useQuery로 요청
jjjwodls
approved these changes
Mar 25, 2025
| function errorHandler(error: any) { | ||
| console.log('AxiosError', error); | ||
| if (error.response) { | ||
| if (axios.isAxiosError(error && error.response)) { |
Collaborator
There was a problem hiding this comment.
error.response 넣지 않고 error 만 넣어도 isAxiosError 를 통해 axios error 인지 체크 가능합니다!
Collaborator
Author
| import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; | ||
| import { useParams, useRouter } from 'next/navigation'; | ||
| import { useEffect, useState } from 'react'; | ||
| import api from '../../../../../../api'; |
Collaborator
There was a problem hiding this comment.
절대 경로 설정을 해주시면 복잡한 상대경로를 해결하실 수 있습니다!
tsconfig.json 에서 baseUrl 을 지정하는 방법을 한 번 확인해 주세요!
Collaborator
Author
There was a problem hiding this comment.
앗 tsconfig에 path를 적용했는데 이 부분만 수정이 누락된 것 같습니다!
수정하겠습니다!
| productId?: string | undefined; | ||
| } | ||
|
|
||
| function CommentList({ articleId, productId }: Props) { |
Collaborator
There was a problem hiding this comment.
id를 단일로 받고 type정보를 추가로 받아 분기하는 방법도 괜찮아 보입니다!
그렇게되면 Id는 필수로 들어오게 되고 type으로만 어떤 api에 요청하여 데이터를 불러올 지 정해주면 되기 때문에 id 존재여부에 대한 분기 로직이 사라지게 됩니다!
어떤 방법이 효율적인지 한번 더 고려해주세요!
Collaborator
Author
There was a problem hiding this comment.
오 이해했습니다. 그게 더 간결할 것 같습니다. 감사합니다!!
Collaborator
|
안녕하세요 형민님! 전반적으로 타입스크립트 적용은 잘 해주셨습니다! 리뷰 남겨드린 부분만 한번 더 확인 해주시고 추가로 궁금한 사항 있으면 질문 부탁드릴게요! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

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