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

[refactor] Change database to MongoDB #119

Merged
merged 92 commits into from
Mar 3, 2022
Merged

[refactor] Change database to MongoDB #119

merged 92 commits into from
Mar 3, 2022

Conversation

holmir97
Copy link
Member

@holmir97 holmir97 commented Mar 3, 2022

🌈 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. 브랜치 삭제

@holmir97 holmir97 added 🌈 refactor 코드 리팩토링 1️⃣ priority: high 우선순위 높음 labels Mar 3, 2022
@holmir97 holmir97 added this to the v2.0.0 milestone Mar 3, 2022
Copy link
Contributor

@seohyun-106 seohyun-106 left a 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)
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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입니다."
Copy link
Contributor

Choose a reason for hiding this comment

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

세심한 메세지 ..

Copy link
Member

@geeneve geeneve left a comment

Choose a reason for hiding this comment

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

고성룡의 몽고디비 마술쇼 잘 보았습니다.

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

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

이거 내가 작업할 때 슬랙 안뜨게할려고 주석한건데 다시 풀자!!

@@ -70,7 +70,7 @@ const postBookController = async (req: Request, res: Response) => {
resData
);
} catch (err) {
slack.slackWebhook(req, err.message);
// slack.slackWebhook(req, err.message);
Copy link
Member

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";
Copy link
Member

Choose a reason for hiding this comment

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

이 파일 원래 js여서 급하게 ts로 바꾼건디 파라미터랑 함수에 타입 지정 해야겠다 나중에


// console.log(decoded.user.id);

// 정상작동
Copy link
Member

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(
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

Doc이 뭔가요??
아 글구 이 부분 arrow function으로 바꾸자!

@holmir97 holmir97 merged commit 74e1877 into develop Mar 3, 2022
@geeneve geeneve deleted the develop-mongo branch March 3, 2022 17:19
@joohaem
Copy link
Member

joohaem commented Mar 4, 2022

12일에 거친 100커밋 잘 보고 갑니다 ... Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1️⃣ priority: high 우선순위 높음 🌈 refactor 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refactor] modify api database to mongoDB
4 participants