React 이석우 sprint mission 5 (V2) 제출#70
Hidden character warning
React 이석우 sprint mission 5 (V2) 제출#70dolby527 wants to merge 6 commits intocodeit-sprint-fullstack:react-이석우from
Conversation
| <Route path="/items" element={<ItemsPage />} /> | ||
|
|
||
| {/* 상품 등록 페이지 */} | ||
| <Route path="/Registeration" element={<RegisterationPage />} /> |
There was a problem hiding this comment.
라우트 경로 오타 및 대소문자 일관성
/Registeration → /registration으로 수정해주세요.
- 오타:
Registeration→Registration - 대소문자: 다른 라우트(
/items)는 소문자인데, 이 라우트만 대문자로 시작합니다.
// 수정 제안
<Route path="/registration" element={<RegistrationPage />} />There was a problem hiding this comment.
Registeration으로 당초 통일하였고, 소문자 시작으로 조정하였습니다.
There was a problem hiding this comment.
RegisterationPage가 맞는것이어서 그대로 반영하였습니다.
| @@ -0,0 +1,22 @@ | |||
| import React from "react"; | |||
| import HeartIcon from "../../../assets/images/icons/ic_heart.svg"; | |||
| import DefaultImage from "../../../assets/images/icons//defaultimage.png"; | |||
There was a problem hiding this comment.
이미지 경로에 슬래시 중복
// 현재
import DefaultImage from "../../../assets/images/icons//defaultimage.png";
// ^^ 슬래시 두 개
// 수정 제안
import DefaultImage from "../../../assets/images/icons/defaultimage.png";There was a problem hiding this comment.
//증복 슬래시 제거하였습니다.
| function ItemCard({ item }) { | ||
| return ( | ||
| <div className="itemCard"> | ||
| {<img src={DefaultImage} alt={DefaultImage} className="itemCardThumbnail" />} |
There was a problem hiding this comment.
불필요한 중괄호 및 alt 속성 개선
// 현재
{<img src={DefaultImage} alt={DefaultImage} ... />}
// 수정 제안
<img src={DefaultImage} alt="상품 이미지" ... />- 불필요한
{}중괄호 제거 alt에 이미지 경로 대신 의미있는 텍스트 사용
There was a problem hiding this comment.
의미있는 코드 "상품 이미지"로 변경하였습니다.
| @@ -0,0 +1,6 @@ | |||
| import React from "react"; | |||
|
|
|||
There was a problem hiding this comment.
재사용성 개선 필요
현재 하드코딩된 텍스트와 클래스명으로 재사용성이 낮습니다.
// 수정 제안
function Button({ children, className, onClick, ...props }) {
return (
<button className={className} onClick={onClick} {...props}>
{children}
</button>
);
}There was a problem hiding this comment.
재사용성 개선 코드로 변경하였습니다.
| throw new NotFoundException('등록하신 상품을 찾을 수 없습니다.'); | ||
| } | ||
|
|
||
| res.json({ |
There was a problem hiding this comment.
console.log 제거
프로덕션 코드에서는 console.log를 제거하거나 로깅 라이브러리를 사용해주세요.
There was a problem hiding this comment.
관련 console.log 제거 하였습니다.
| }); | ||
|
|
||
| // POST /products - 새 product 생성 | ||
| productRouter.post('/', validateProduct, async (req, res, next) => { |
There was a problem hiding this comment.
주석 처리된 코드 정리
사용하지 않는 주석 코드는 삭제해주세요. Git 히스토리에서 추적 가능합니다.
There was a problem hiding this comment.
불필요한 채 comment는 제거하도록 하겠습니다.
안녕하세요?
미션 5 과제 제출합니다.