Skip to content

최우진 sprint mission 4#65

Open
DevWoojin97 wants to merge 6 commits intocodeit-sprint-fullstack:basicfrom
DevWoojin97:basic
Open

최우진 sprint mission 4#65
DevWoojin97 wants to merge 6 commits intocodeit-sprint-fullstack:basicfrom
DevWoojin97:basic

Conversation

@DevWoojin97
Copy link
Collaborator

아직 css 적용 못한 상태입니다

@DevWoojin97 DevWoojin97 requested a review from reach0908 January 7, 2026 09:56
@DevWoojin97 DevWoojin97 self-assigned this Jan 7, 2026
@DevWoojin97 DevWoojin97 added the 미완성 스프린트 미션 제출일이지만 미완성했습니다. 죄송합니다. label Jan 7, 2026
@DevWoojin97 DevWoojin97 changed the title 스프린트 미션4 css 남음 최우진 sprint mission 4 Jan 7, 2026
@reach0908
Copy link
Collaborator

Copy link
Collaborator

@reach0908 reach0908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

각 코드의 리뷰들이 다른 파일에서도 동일하게 적용되는 부분들이 있어 같이 개선하면 좋을 듯 싶습니다.

hook 이라는 개념을 통해 비동기 처리 로직을 관리하고 비동기 통신, async await를 사용할때는 항상 try catch와 같이 사용하면 좋습니다. 예상치못한 에러에 사용자가 불편을 겪지않도록 잘 관리할 수 있습니다.

Comment on lines 9 to 24
useEffect(() => {
const getProducts = async () => {
const params = new URLSearchParams({
page: 1,
pageSize: 4,
orderBy: 'recent',
});
const res = await fetch(
`https://panda-market-api.vercel.app/products?${params.toString()}`
);
const data = await res.json();
setProducts(data.list);
};

getProducts();
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비동기 API 요청들은 try catch문으로 감싸서 예상치못한 에러를 핸들링하면 좋습니다!

<div className={styles.bestItemsContainer}>
<h2 className={styles.bestItem}>베스트 상품</h2>
<ul className={styles.bestItemsBox}>
{products.map((product) => (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

products 배열의 길이가 0인 경우 혹은 products가 배열이 아닐때를 핸들링하면 좋을 것 같습니다!

products?. 와 같이 옵셔널 체이닝 이란 것을 활용하면 됩니다

currentPage,
handlePageChange,
}) {
const totalPages = Math.ceil(totalCount / pageSize);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totalCount가 숫자가 아니거나 undefined일때를 대비하여 핸들링을 해주면 좋을 것 같습니다!

const totalPages = Math.ceil(totalCount || 0) / pageSize)

</div>
<div className={styles.footerBoxEnd}>
<a
href="https://www.facebook.com/login.php/?lang=ko"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

외부 링크에 rel="noopener noreferrer" 속성이 없어 보안 취약점이 존재합니다 (Tabnabbing 공격)

}, [orderBy, keyword, currentPage]);

return (
<>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

단일 루트 요소만 있는 경우에는 해당 Fragment는 없어도 괜찮습니다!

@DevWoojin97 DevWoojin97 reopened this Jan 12, 2026
@DevWoojin97 DevWoojin97 added 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요! and removed 미완성 스프린트 미션 제출일이지만 미완성했습니다. 죄송합니다. labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants