[신민준] Sprint 11#22
Merged
Irelander merged 47 commits intocodeit-sprint-fullstack:express-신민준from Dec 1, 2025
Merged
Conversation
docs: complete Swagger API documentation
chore: add reset.ts and seed.ts
chore: remove package-lock.json to resolve npm errors
fix: resolve Prisma P3018 error
chore: fix P3009 error by running migrate reset
docs: add README.md
fix auth.controller.ts issue
feat: implement logout logic
feat: include user nickname in articles response
Irelander
approved these changes
Dec 1, 2025
Collaborator
Irelander
left a comment
There was a problem hiding this comment.
Zod를 잘 활용하시는 점이 눈에 띄네요 ㅎㅎ 전반적으로 클린하고 좋은 코드를 작성하시는거 같아요!
큰 이슈들은 아닌데 아래 몇가지 부분들만 수정하면 더 좋을꺼 같습니다 ㅎㅎ
- 중복 검증 줄이기: 라우터 미들웨어에서 이미 검증된 데이터를 컨트롤러(
getAllArticlesController)에서 다시 파싱하는 경우가 있습니다. 미들웨어를 신뢰하고 중복 연산을 줄여보세요! - 데이터 무결성 및 보안:
signupService에서 Refresh Token을 생성만 하고 DB에 저장하지 않는 치명적인 실수가 발견되었습니다. 또, 로그아웃 시 토큰 검증 로직이 빠져 있어 보안 취약점이 될 수 있으니 꼭 보완해주세요. any단언 지양: 검증 로직은 완벽한데 마지막에as any로 타입을 뭉개버리는 부분이 있어 아쉬웠습니다.Express.Request확장을 통해 타입 안전성을 끝까지 가져가 봅시다!
조금만 다듬으면 정말 완벽한 코드가 될 것 같습니다. 이번 스프린트도 고생하셨습니다.
Comment on lines
+14
to
+19
| const { | ||
| cursor, | ||
| limit = 10, | ||
| searchQuery = '', | ||
| sort = 'recent', | ||
| } = getArticlesQuerySchema.parse(req.query); |
Collaborator
There was a problem hiding this comment.
라우터 레벨에서 validateQuery 미들웨어를 이미 통과했으므로,
여기서 다시 schema.parse()를 호출할 필요가 없습니다! (이중 검증)
req.query에 이미 검증되고 변환된 값이 들어있을 거예요.
| data = req.body; | ||
| } | ||
|
|
||
| const result = schema.parse(data) as any; |
Collaborator
There was a problem hiding this comment.
여기서 as any를 사용하면 Zod가 검증해준 타입 정보를 잃어버리게 돼요.
schema.parse()가 반환하는 타입은 안전하므로, 이를 제대로 활용하려면 Request 타입을 제네릭으로 확장하거나
res.locals 등을 활용해서 안전하게 데이터를 전달하는 방법을 고민해보면 좋을 것 같아요!
Comment on lines
+4
to
+9
| export const getAllProductsRepository = async ( | ||
| page: number, | ||
| limit: number, | ||
| whereCondition: ProductWhereInput, | ||
| orderBy: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[], | ||
| ) => { |
Collaborator
There was a problem hiding this comment.
인자가 많아질 때는 이렇게 개별적으로 받기보다는 하나의 객체로 묶어서 받는 것(Parameter Object Pattern)이 유지보수에 더 유리해요!
interface GetProductsParams { page: number; limit: number; ... } 처럼 인터페이스를 정의해보는 건 어떨까요?
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.
요구사항
기본 요구사항
공통
백엔드
Comment