-
Notifications
You must be signed in to change notification settings - Fork 0
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
[3주차] 기본/도전 과제 #3
Conversation
|
||
const getContent = async (req: Request, res: Response) => { | ||
const {contentId} = req.params; | ||
|
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.
예외처리가 필요하다면 if와 not 연산자를 활용해서 아래와 같이 에러를 핸들링해줄 수 있습니다 !
if (!contentId){
return res.status(404).json({ status: 404, message: "데이터가 없습니다." });
}
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.
영화나 드라마가 같은 형태여서 contentId
로 구현해주신 점 멋지십니다👍 사실 저도 과제하면서 아차 싶었거든요🥲 과제를 하거나 개인적으로 공부하다가 궁금한 점이 있다면 언제든지 코드리뷰 조 활용해주세요:) 같이 공부해요~ 과제하느라 고생 많이 하셨습니다😊
const getItem = async (contentId: number) => { | ||
return contents[contentId]; | ||
}; |
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.
음! 2주차 과제에 되어있던 폴더 분리는 아무래도 작성한 api에 대한 로직이 없던터라, 확실히 이번 과제에 적용하셨을 때 애매하고 긴가민가 하셨을 수도 있을거라는 생각이 듭니다.
저의 얄팍한 지식으로 프로젝트 구조에 대해서 간단히 언급해보자면 저희가 학습하고 있는 Express는 관심사 분리 원칙 어쩌구에 따라 node.js 프로젝트 구조에서 3 Layer Architecture를 도입한다고 하네요:)
세미나를 진행하면서 파트장님께서 잘 설명해주시겠지만, 간단하게라도 알고 계시면 좋을거 같아서 관련내용 링크 달아놓겠습니다!
https://charming-kyu.tistory.com/16
https://velog.io/@ju_h2/Node-express-%EC%84%9C%EB%B2%84%EC%97%90-3-Layer-Architecture-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0
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.
헉😮..! 유익한 내용 공유해주셔서 감사합니다 !🙏
"description": "성대한 결혼식에서 신부의 웨딩드레스가 벗겨지는 사고가 발생한다. 한바다는 호텔을 상대로 10억 청구 소송을 진행하게 되고, 영우는 준호와 일일 커플이 되어 호텔 잠입 조사를 벌인다." | ||
}, { | ||
"episode": 3, | ||
"description": "친형을 폭행하여 죽음에 이르게 한 중증 자폐인이 기소된다. 영우는 자폐를 지닌 피고인과 소통하기 위해 기발한 방법을 생각해 내고, 한바다 변호사들을 불러 모은다." |
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.
늦은 코드리뷰 왔습니당 늦어져서 미안해용 😂
코드 모두 보았는데 깔끔하게 잘하신거 같아요!! 저도 열심히 배우고 갑니다!
const getContent = async (req: Request, res: Response) => { | ||
const {contentId} = req.params; | ||
|
||
const data = await getItem(Number(contentId)); |
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.
안녕하세요 늦은 코드 리뷰 하러 왔어요 🥲 늦어져서 미안합니당
최근 세미나에서 저도 얻은 꿀팁이지만 +contentId 로 하면 string이 바로 number로 바뀐다고 하네용
"episode": 6, | ||
"description": "요환의 갑작스러운 돌발 행동으로 인구의 신변을 보호하기 위한 계획에 차질이 생긴다. 요환의 마약제국을 무너뜨리기 위한 작전이 시작되고, 그 사이 이상준이 공항에 도착한다." | ||
}], | ||
"episodeCount": 6 |
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.
살짝 기억이 가물가물해서 여쭤보는건데 혹시 저희 episode의 개수를 episode.length가 아니라 episodeCount: 6 으로 했던 이유가 뭐였죵..??! 개인적으로 보았을 때는 episodes 개수에 대한 정보는 충분히 들어가는거 같은데 따로 column를 만드는게 맞는지? 에 대한 의문이 저는 쪼~끔 들어용!
@@ -0,0 +1,56 @@ | |||
import { Content } from "../interface/content"; |
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.
interface 를 이용해서 type 정의를 하니 코드가 깔끔해보여서 좋아용
SERVER PR
🐕 과제 구현 명세
🐥 이런 점이 새로웠어요 / 어려웠어요