Week7/celine m1#70
Open
yoons-art wants to merge 30 commits into
Open
Conversation
feat: 1주차 미션 완료
Week3/celine m2
Week3/celine m3
Week4/celine m2
Week4/celine m3
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
yewon20804
reviewed
May 19, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
7주차 미션 확인했습니다 ! 이번 미션은 useMutation을 활용해보는거였습니다 😀
코멘트 확인 부탁드립니다 ~
1. lp.ts — 백틱 vs 따옴표 오타
// ❌ 현재
export const postLike = async({ lpId }: RequestLpDto): Promise<ResponseLikeLpDto> => {
const { data } = await axiosInstance.post('/v1/lps/${lpId}/likes');
return data;
}
export const deleteLike = async({ lpId }: RequestLpDto): Promise<ResponseLikeLpDto> => {
const { data } = await axiosInstance.delete('/v1/lps/$(lpId)/likes');
return data;
}
// ✅ 수정
export const postLike = async({ lpId }: RequestLpDto): Promise<ResponseLikeLpDto> => {
const { data } = await axiosInstance.post(`/v1/lps/${lpId}/likes`);
return data;
}
export const deleteLike = async({ lpId }: RequestLpDto): Promise<ResponseLikeLpDto> => {
const { data } = await axiosInstance.delete(`/v1/lps/${lpId}/likes`);
return data;
}
postLike와 deleteLike 함수에서 URL에 변수를 넣어야 하는데 백틱(`) 대신 따옴표(')를 사용해서 URL에 lpId가 실제 숫자로 들어가지 않고 문자 그대로
2. LpDetailPage.tsx — 로딩/에러 조건 오류
// ❌ 현재
if (isPending && isError) {
return <></>;
}
// ✅ 수정
if (isPending) {
return <div>로딩 중...</div>;
}
if (isError) {
return <div>에러가 발생했습니다.</div>;
}
isPending && isError는 동시에 true가 될 수 없습니다 ! 로딩 중일 때와 에러가 발생했을 때를 각각 따로 처리해야합니다 :)
3. components/LpCard/LpCard.tsx — navigate 경로 오류
// ❌ 현재
<div onClick={() => navigate(`./lps/${lp.id}`)}>
// ✅ 수정
<div onClick={() => navigate(`/lps/${lp.id}`)}>
./lps/${lp.id}로 이동하면 현재 경로 기준 상대 경로가 되어서 의도한 페이지로 이동이 안 될 수 있습니다 !. 절대 경로로 수정하면 좋습니다 !
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.
📚 주차 / 미션
📌 작업 내용
-useMutation을 활용하여 서버 상태 손쉽게 관리하기
✨ 상세 작업 내용
✅ 체크리스트