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.
orderComplete 페이지에서, 주문한 상품 내역이 안나오는 오류를 수정했습니다.
전체 코드
수정 이전
기존 코드는 비동기 완료 이전에 cartItems가 삭제되면서 matchedTransactionDetails 호출 중에 비교할 cartItems가 빈 배열로 나타남. matchedTransactionDetails 완료 이후에 removeCartItemsByUser가 실행되도록 then메서드 사용.
또한, cartItems는 customHooks인 useCartItems에서 userInfo를 받아오게 되면 활성화되는데, 따라서 useEffect 감시 데이터에도 userInfo를 추가해줌.
수정 이후
orderComplete 페이지에서, 주문내역 확인하기 버튼의
<Btn text="주문내역 확인하기" targetURL="/user/:username" />
을<Btn text="주문내역 확인하기" targetURL={
/user/${userInfo.displayName}/getItemAll} />
로 바로 getItemAll로 이동하도록 수정했습니다.