Skip to content

[안예진]sprint5 미션 제출#5

Open
yyejin00 wants to merge 5 commits intocodeit-sprint-fullstack:express-안예진from
yyejin00:express-안예진-sprint5

Hidden character warning

The head ref may contain hidden characters: "express-\uc548\uc608\uc9c4-sprint5"
Open

[안예진]sprint5 미션 제출#5
yyejin00 wants to merge 5 commits intocodeit-sprint-fullstack:express-안예진from
yyejin00:express-안예진-sprint5

Conversation

@yyejin00
Copy link
Collaborator

@yyejin00 yyejin00 commented Jan 18, 2026

백엔드 구현 요구사항

  • Product 스키마를 작성해 주세요.

  • id, name, description, price, tags, createdAt, updatedAt필드를 가집니다.

  • 필요한 필드가 있다면 자유롭게 추가해 주세요.

  • 상품 등록 API를 만들어 주세요.
    name, description, price, tags를 입력하여 상품을 등록합니다.

  • 상품 상세 조회 API를 만들어 주세요.
    id, name, description, price, tags, createdAt를 조회합니다.

  • 상품 수정 API를 만들어 주세요.
    PATCH 메서드를 사용해 주세요.

  • 상품 삭제 API를 만들어 주세요.

  • 상품 목록 조회 API를 만들어 주세요.
    id, name, price, createdAt를 조회합니다.

  • offset 방식의 페이지네이션 기능을 포함해 주세요.

  • 최신순(recent)으로 정렬할 수 있습니다.

  • name, description에 포함된 단어로 검색할 수 있습니다.

  • 각 API에 적절한 에러 처리를 해 주세요.

  • 각 API 응답에 적절한 상태 코드를 리턴하도록 해 주세요.

  • . env 파일에 환경 변수를 설정해 주세요.

  • CORS를 설정해 주세요.

  • render.com로 배포해 주세요.

  • MongoDB를 활용해 주세요.

@yyejin00 yyejin00 requested a review from wseungjin January 18, 2026 03:38
@yyejin00 yyejin00 self-assigned this Jan 18, 2026
@yyejin00 yyejin00 added 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 진행중 아직 스프린트 미션 제출일이 아닙니다. 새로 커밋된 내용에 대해 코드리뷰 해주세요! (2주 이상의 스프린트 미션 중간점검 PR 제출시 사용합니다.) labels Jan 18, 2026
@yyejin00 yyejin00 added 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요! and removed 진행중 아직 스프린트 미션 제출일이 아닙니다. 새로 커밋된 내용에 대해 코드리뷰 해주세요! (2주 이상의 스프린트 미션 중간점검 PR 제출시 사용합니다.) labels Jan 18, 2026
Copy link
Collaborator

@wseungjin wseungjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~

const { search } = req.query;
const query = {};
if (search) {
query.$or = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const query = {
{ name: { $regex: search, $option: "i" } },
{ description: { $regex: search, $option: "i" } },

};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ a ? ... ({)}


productRouter.delete("/:id", async (req, res, next) => {
try {
const deleteProduct = await Product.findByIdAndDelete(req.params.id);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findByIdAndDelete

delete : true 이런식으로 합니다

//상품 수정
productRouter.patch("/:id", async (req, res, next) => {
try {
const { name, description, price, tags } = req.body;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation 신경

}
});

//상품등록, 중복확인?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id가 필요하지 않을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

게시글도 id가 있어요

productRouter.get("/", async (req, res, next) => {
//상품 목록 조회
try {
const products = await Product.find().select("_id name price createdAt"); //SELECT id, name, price, created_at FROM products;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getProducts()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants