[김희성] sprint 10#31
Merged
rjc1704 merged 1 commit intocodeit-sprint-fullstack:express-김희성from Mar 24, 2025
HEES56:express-김희성-10
Hidden character warning
The head ref may contain hidden characters: "express-\uae40\ud76c\uc131-10"
Merged
[김희성] sprint 10#31rjc1704 merged 1 commit intocodeit-sprint-fullstack:express-김희성from HEES56:express-김희성-10
rjc1704 merged 1 commit intocodeit-sprint-fullstack:express-김희성from
HEES56:express-김희성-10
Conversation
rjc1704
reviewed
Mar 24, 2025
| user User? @relation(fields: [userId], references: [id], onDelete: SetNull) | ||
| article Article? @relation(fields: [articleId], references: [id], onDelete: Cascade) | ||
| product Product? @relation(fields: [productId], references: [id], onDelete: Cascade) | ||
|
|
There was a problem hiding this comment.
userId 도 다른 외래키들과 마찬가지로 index 로 색인을 달아두는 것이 좋겠습니다. 댓글정보를 불러올때 조회성능을 높일 수 있겠습니다.
rjc1704
reviewed
Mar 24, 2025
| userId String? | ||
| productId String? | ||
| id String @id @default(uuid()) | ||
| userId String? |
There was a problem hiding this comment.
댓글은 로그인을 한 유저만 등록할 수 있기 때문에, userId 는 필수값으로 설정되어야 합니다. productId 와 articleId 는 댓글 모델을 공유하고 있기 때문에 옵셔널로 되어있는 것이 맞습니다.
rjc1704
reviewed
Mar 24, 2025
| import multer from "multer"; | ||
| import { validateProduct } from "../middlewares/validateProduct.js"; | ||
| import asyncHandler from "../middlewares/asyncHandler.js"; | ||
|
|
There was a problem hiding this comment.
multer 의 경우, 이미지를 저장하려는 경로에 해당하는 폴더가 존재하지 않는 경우, 자동으로 생성해주는 로직이 내장되어 있지 않습니다. 그래서 multer 로 이미지를 서버 내 특정 경로에 저장하는 경우 보통 아래 코드를 먼저 사용합니다.
// uploads 폴더가 없으면 생성
const uploadDir = "uploads/";
if (!fs.existsSync(uploadDir)) {
fs.mkdirSync(uploadDir, { recursive: true });
}
|
희성님 스프린트 10 수행하시느라 고생하셨습니다! 프로젝트 준비중에도 성실하게 스프린트에 임해주셔서 감사합니다.
|
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.
요구사항
기본
상품 등록
상품 상세
좋아요 기능
에러 처리
라우트 중복 제거
인증
상품 기능 인가
게시글 기능 인가
댓글 기능 인가
심화
인증
주요 변경사항
멘토에게