-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NDD-270] 문제집 세부 정보페이지 개발하기 (4h/5h) #129
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.
수고하셨습니다~ 새 기획에서 해민님 부분이 90%정도 마무리되었군요!!
- 로더를 이용해서 현제 어느 페이지를 보여줄 것인가에 대해서 체크를 진행한다.
- 문제집의 문제들을 가져오는 hook을 생성한다
Deploying with Cloudflare Pages
|
2d8e897
to
c7d569f
Compare
: setIsModalOpen(true); | ||
}; | ||
|
||
if (!workbookData) return; |
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.
[p-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.
넵넵 타입때문에 작성했네요 ㅎㅎ
Why
api가 많아지다보니 슬슬 햇갈리기 시작하네요 ㅠㅠ querykey중복 이슈떄문에 30분동안 헤매고 있었습니다. 생각보다 얽힌게 많은것 같아요 주말에 풀어보도록 하죠
How
문제집 세부정보 페이지를 완성하였습니다. 아직 연결하지 못한 부분 => 문제집에 추가가 되고 난 이후에 유저를 어디로 보내줘야할지에 대한 내용은 성인님 페이지가 완성되고 연결하는것이 좋을것 같아요 아직 PATH가 없어서 못하더라고요
포인트1
const { workbookId } = useLoaderData() as { workbookId: number };
코드 중에 다음과 같은 코드가 있는데 이는 path의 workbookId를 추출해 내는 코드입니다. 제가 지금 사용하는 페이지의 경로는 다음과 같은데
interview/workbook/:workbookId
이중에서 loader단에서 workbookId를 검증하고 맞는 타입이라면 위의 코드처럼 사용해 페이지 내부에서 workbookId를 사용할 수 있습니다.포인트2
기존의 mutate 방법으로 사용하니 onSuccess 옵션을 계속 사용해야 하고 그러다 보니 callback hell과 같은 상황이 펼쳐 졌습니다. 그래서 이전 PR에서 사용했던 mutateAsync 방법을 사용해서 직접 async/awiat으로 변경하였습니다
Result