-
Notifications
You must be signed in to change notification settings - Fork 1
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
[refactor] Change database to MongoDB #119
Conversation
Refactor/switch database from postgreSQL to MongoDB
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 review = await Review.findById( | ||
new mongoose.Types.ObjectId(reviewId) |
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.
우와 이거 new는 머야
await review.save(); | ||
// snake to camel | ||
const originReview = keysToCamel(review); | ||
const camelReview = keysToCamel(originReview.Doc); |
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 (!review) { | ||
return constant.WRONG_REQUEST_VALUE; | ||
return constant.DB_NOT_FOUND; |
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.
ㄷ ㄷ ㄷ 꼼꼼선배 ㄷ ㄷ
@@ -412,7 +412,7 @@ const deleteReviewController = async (req: Request, res: Response) => { | |||
res, | |||
returnCode.BAD_REQUEST, | |||
false, | |||
"존재하지 않는 Review입니다." | |||
"존재하지 않거나 삭제된 Review입니다." |
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.
고성룡의 몽고디비 마술쇼 잘 보았습니다.
src/controller/auth.ts
Outdated
@@ -70,7 +70,7 @@ const getEmailController = async (req: Request, res: Response) => { | |||
{ isValid: true } | |||
); | |||
} catch (err) { | |||
slack.slackWebhook(req, err.message); | |||
// slack.slackWebhook(req, err.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.
이거 내가 작업할 때 슬랙 안뜨게할려고 주석한건데 다시 풀자!!
src/controller/book.ts
Outdated
@@ -70,7 +70,7 @@ const postBookController = async (req: Request, res: Response) => { | |||
resData | |||
); | |||
} catch (err) { | |||
slack.slackWebhook(req, err.message); | |||
// slack.slackWebhook(req, err.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.
여기도 주석해제
@@ -0,0 +1,62 @@ | |||
import _ from "lodash"; |
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.
이 파일 원래 js여서 급하게 ts로 바꾼건디 파라미터랑 함수에 타입 지정 해야겠다 나중에
src/middleware/authMiddleware.ts
Outdated
|
||
// console.log(decoded.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.
확인이요... 왜이런거지
reviewSt: 2, | ||
finishSt: false, | ||
}); | ||
const review = await Review.create( |
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.
default값으로 생성하는거 아이디어 기가맥히네요 😎
reviews.map(async function (review) { | ||
// snake to camel | ||
const originReview = keysToCamel(review); | ||
const camelReview = keysToCamel(originReview.Doc); |
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.
Doc이 뭔가요??
아 글구 이 부분 arrow function
으로 바꾸자!
12일에 거친 100커밋 잘 보고 갑니다 ... Good |
🌈 PR 요약 / Linked Issue
PostgreSQL -> MongoDB
close #115 #114 #113 #112
📌 변경 사항
모든 service 로직 수정
미들웨어 수정
library 추가
controller 수정
✅ PR check list
1. 제목 양식 준수 확인
[feat] PR title
2. 테스트 코드 작동 스크린샷
npm run mocha
✅ After merge check list
1. 릴리즈 노트 변경
릴리즈 노트 To Do에서 Done으로 옮기기
2. 브랜치 삭제