[김재욱] Sprint 10#39
Merged
reach0908 merged 17 commits intocodeit-sprint-fullstack:express-김재욱from May 21, 2025
Hidden character warning
The head ref may contain hidden characters: "express-\uae40\uc7ac\uc6b1"
Merged
Conversation
reach0908
reviewed
May 21, 2025
reach0908
left a comment
There was a problem hiding this comment.
고생많으셨습니다.
코드들이 전반적으로 깔끔하고 가독성이 좋은 것 같습니다!
크리티컬한 부분은 없으나 미리 습관을 들여두면 좋은 부분들 위주로 개선사항을 적어보았습니다.
Comment on lines
+9
to
+11
| const accessToken = generateAccessToken(newUserInfo.id); | ||
| const refreshToken = generateRefreshToken(newUserInfo.id); | ||
| await authService.saveRefreshToken(newUserInfo.id, refreshToken); |
There was a problem hiding this comment.
[P1]
토큰 모듈 같은 것들을 통해 전체 토큰을 발급하고 저장하는 것을 관리하는 서비스 로직으로 합치면 좋을 것 같습니다.
Comment on lines
+9
to
+18
| let articleId = null; | ||
| let productId = null; | ||
|
|
||
| if (itemType === 'articles') { | ||
| articleId = itemId; | ||
| } else if (itemType === 'products') { | ||
| productId = itemId; | ||
| } else { | ||
| return res.status(400).json({ message: '잘못된 itemType입니다.' }); | ||
| } |
There was a problem hiding this comment.
[P2]
이런 검증 및 파라미터의 변환은 미들웨어를 통해 해주는 것도 좋습니다!
There was a problem hiding this comment.
해당 변수들을 확인하고 넣어주는 과정에서 아래 진행되는 parseInt 작업도 이 단계에서도 해줘도 괜찮을 것 같습니다.
Comment on lines
+8
to
+20
| const existingUserByEmail = await userRepository.findUserByEmail(email); | ||
| if (existingUserByEmail) { | ||
| const error = new Error('이미 존재하는 이메일입니다.'); | ||
| error.code = 409; | ||
| throw error; | ||
| } | ||
|
|
||
| const existingUserBynickname = await userRepository.findUserBynickname(nickname); | ||
| if (existingUserBynickname) { | ||
| const error = new Error('이미 존재하는 닉네임입니다.'); | ||
| error.code = 409; | ||
| throw error; | ||
| } |
There was a problem hiding this comment.
[P1]
실행 순서는 관계없는 부분인 것 같으니 병렬적으로 처리해보면 어떨까요?
Comment on lines
+6
to
+7
| console.log("articleId:", articleId) | ||
| console.log("productId:",productId) |
There was a problem hiding this comment.
[P0]
항상 디버깅용 console.log는 삭제하고 리모트에 푸쉬하는 습관을 길러주세요!
3f81c54
into
codeit-sprint-fullstack:express-김재욱
1 check passed
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.
요구사항
기본
공통
상품 등록
상품 상세
좋아요 기능
에러 처리
라우트 중복 제거
인증
상품 기능 인가
게시글 기능 인가
댓글 기능 인가
심화
상태코드 (웹 API 관련)
인증
적용)
OAuth를 활용한 인증
프로젝트 구조 변경
(생략 가능) 자유게시판 게시물 등록
는 최대 3개까지만 등록 가능하도록 구현해 주세요.
주요 변경사항
멘토에게