전남대 FE_임지환 5주차 과제#17
Open
dlawlghks wants to merge 25 commits intokakao-tech-campus-2nd-step2:dlawlghksfrom
Open
전남대 FE_임지환 5주차 과제#17dlawlghks wants to merge 25 commits intokakao-tech-campus-2nd-step2:dlawlghksfrom
dlawlghks wants to merge 25 commits intokakao-tech-campus-2nd-step2:dlawlghksfrom
Conversation
Author
|
멘토님 추가로 STEP2도 진행해보았습니다! |
tlsehdfl
reviewed
Jul 30, 2024
| } | ||
|
|
||
| const storedUsers = JSON.parse(localStorage.getItem('users') || '[]'); | ||
| const userExists = storedUsers.some((user: { id: string }) => user.id === id); |
There was a problem hiding this comment.
컴포넌트가 렌더링 될 때마다 storedUsers.some 연산을 수행할 텐데요. useMemo 으로 메모이제이션 해주는게 좋을거 같습니다.
| useEffect(() => { | ||
| const fetchWishlist = async () => { | ||
| if (authInfo) { | ||
| setLoading(true); |
There was a problem hiding this comment.
authInfo 의 유무에 상관없이 loading 상태로 진입하는게 좋을거 같습니다.
| setLoading(true); | ||
| try { | ||
| const response = await fetchInstance.get( | ||
| '/api/wishes?page=0&size=10&sort=createdDate,desc', |
There was a problem hiding this comment.
Suggested change
| '/api/wishes?page=0&size=10&sort=createdDate,desc', | |
| '/api/wishes', { params: { page: 0, size: 10, sort: 'createdDate,desc' } } |
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.
안녕하세요 멘토님.
5주체 과제 STEP1을 진행해보았습니다.
열심히 해보았지만, test 코드를 작성하는 것이 조금 미숙하다 보니 어려움이 있었습니다.
Goods/Detail/index.test.tsx 코드에서는 테스트가 잘 되었지만
Order/index.test.tsx 코드를 작성하는 도중 현금영수증 체크박스 상태에 따른 필드 활성화 상태를 확인하는 테스트에서 문제가 생겼습니다.
혹시 이 문제들을 해결하기 위해 제가 놓치고 있는 부분이 있을까요? 추가적으로 확인해봐야 할 사항이 있다면 조언 부탁드립니다.
항상 피드백 해주셔서 감사합니다.