Skip to content
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

[7주차] 기본 과제 제출 #8

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

[7주차] 기본 과제 제출 #8

wants to merge 7 commits into from

Conversation

dahyunnee
Copy link
Contributor

@dahyunnee dahyunnee commented Dec 1, 2022

SERVER PR


🐕 과제 구현 명세

  • 기본 : Mutler을 이용해 AWS S3에 이미지 업로드하기 ( 저번주 도전과제 못한거 리팩토링까지 같이 했어요)
  • 도전
    • content 검색 + Pagination
      : 제목에 keyword 포함되고 option의 배우들 이름 포함된 작품을 paging 해서 줌
      -> [GET] /content/search?keyword=제목키워드&option=배우1&option=배우2&page=1&limit=2
    • content 등록 API (이미지 포함)
      -> [POST] /content : content와 이미지 함께 등록
      -> [POST] /image : 존재하는 작품에 이미지만 등록(작품의 아이디는 body로 받기)

🐥 이런 점이 새로웠어요 / 어려웠어요

  • prisma 공부 중인데 기능이 엄청 많네용.. 언제 다 보냐?
  • query로 배열 넘기고 받는 거 해봤습니다

Copy link
Member

@hyeonjeongs hyeonjeongs left a comment

Choose a reason for hiding this comment

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

엄청난 발전이 보이군요! 너무 수고했어영 !

Comment on lines +25 to +26
const contentDTO:searchContentDTO = req.query as any;
//~ const { keyword, option, page, limit } = req.query;
Copy link
Member

Choose a reason for hiding this comment

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

DTO에 쿼리값 받도록 설정해서 넘 깔끔하군요 !

Copy link
Member

Choose a reason for hiding this comment

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

오 쿼리로 배열을 받을 수 있는지 몰랐는데 저런식으로 받을 수가 있군요...! 역시 다현쓰 최고입니당

Comment on lines +50 to +57
//! option = ['배우1', '배우2'] 같은 경우
const contentList = await prisma.product.findMany({
where: {
title: {
contains: searchDTO.keyword
},
actor: {
hasSome: searchDTO.option,
Copy link
Member

Choose a reason for hiding this comment

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

오호 배우를 받아와서 페이징처리 조건으로 설정해줬군요 ! 역시 넘잘해영

Copy link
Member

@hyeonjeongs hyeonjeongs left a comment

Choose a reason for hiding this comment

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

최고오옹

Comment on lines +55 to +57
},
actor: {
hasSome: searchDTO.option,
Copy link
Member

Choose a reason for hiding this comment

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

배우를 포함하는 경우만 find 하도록 필터링 해준건가요 ?? In과의 차이가 있을까요?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants