-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] 상품 정보 UPDATE #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 코드에 대한 작업은 어떻게 진행할지 의견을 공유해주세요!
const productUpdate = catchAsync(async (req, res) => { | ||
const { productId } = req.params; | ||
const { name, description, price, location, latitude, longitude, product_status_id, category_id, image_url } = req.body; | ||
const userId = 1; //req.user.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
토큰을 처리할 수 있는 코드를 만드셔서 이 부분은 하드 코딩되어 있을 필요가 없어보입니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 반영했습니다
|
||
await productService.productUpdate( productId, name, description, price, location, latitude, longitude, product_status_id, category_id, image_url); | ||
|
||
return res.status(201).json({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
201은 update를 의미하는 상태 코드가 아니니 수정해주세요.
src/routes/product.router.js
Outdated
@@ -0,0 +1,7 @@ | |||
const routes = require("express").Router(); | |||
const productController = require("../controllers/product.controller"); | |||
//const { verifyToken } = require("../utils/verifyToken") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
259df5c
to
72ad7ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이외에는 주석이 너무 많아 말씀드리기가 곤란합니다. 불필요한 주석은 최대한 지우시고 올려주시고 주석을 하신 타당한 이유가 있다면 그것에 대한 커멘트도 남겨주세요. PR로 소통하는 것은 개발자가 일을 할 때 갖춰야 할 가장 중요한 기술입니다.
bucket: process.env.BUCKET_NAME, | ||
contentType: multerS3.AUTO_CONTENT_TYPE, | ||
key: (req, file, callback) => { | ||
const uploadDirectory = req.query.directory ?? '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
req.query.directory
를 보니 어디다 저장할지 클라이언트로 부터 받으려고 하시는게 맞을까요?
굳이 그럴 필요가 없어보입니다. 버킷 내 어느 디렉토리에 저장할지는 각 서비스의 서버에서 관리하는 것이 더 좋아보입니다.
직접 작성한 코드가 아니라 긁어온 자료라서 뭘 어떻게 물어봐야할지 모르겠습니다 AWS S3 생성, routes: ...라는 미들웨어를 사용한다는 것까지 이해했습니다 |
:: 최근 작업 주제 (하나 이상의 주제를 선택해주세요.)
:: 구현 목표 - 해당 브랜치(PR)에서 구현하고자 하는 하나의 목표 작성
:: 구현 사항 설명 - 해당 브랜치(PR)에서 작업한 내용 작성
:: 테스트 결과 이미지
:: 기타 질문 및 특이 사항