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

[NDD-111]: Question API에서 질문을 등록하고, 삭제하는 기능 구현(2/2) #34

Merged
merged 12 commits into from
Nov 13, 2023

Conversation

JangAJang
Copy link
Collaborator

@JangAJang JangAJang commented Nov 11, 2023

NDD-111 Powered by Pull Request Badge

Why

질문 저장, 질문 삭제 로직을 수행시켜 커스텀 질문을 회원이 작업할 수 있게 해준다.

How

작성

  1. 요청이 회원인지 검증한다(AuthGuard)
  2. 회원이라면 질문의 Content가 있는지 검증한다(Class-Validator)
  3. 객체를 만들어 저장한다.
  4. 201코드를 반환한다.

삭제

  1. 요청이 회원인지 검증한다(AuthGuard)
  2. questionId, 토큰에서 memberId를 받는다.
  3. 해당 questionId, memberId가 다대다 매핑의 테이블에 있는지 확인한다.
  4. 있다면 삭제한다.
  5. 없다면 예외처리한다.

Result

스크린샷 2023-11-12 19 07 48 스크린샷 2023-11-12 19 08 06

Prize

권한을 통한 추가, 삭제를 성공시켰다.
하지만 다대다 매핑으로 관계를 만든 후, 조회의 과정에서 쿼리문을 수정해야 할 필요가 있다
또한, 조회의 과정에서 대표답변을 추가해야 하는 상황을 고려했을 때, Answer API의 기본적인 부분을 수행한 후 추가해야 할 것 같다.

Copy link

cloudflare-workers-and-pages bot commented Nov 11, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0509c4a
Status: ✅  Deploy successful!
Preview URL: https://010154ab.gomterview.pages.dev
Branch Preview URL: https://feature-ndd-111.gomterview.pages.dev

View logs

@JangAJang JangAJang added BE 백엔드 코드 변경사항 feature 새로운 기능이 추가 된 경우 labels Nov 11, 2023
@JangAJang JangAJang changed the title feat: 질문을 추가하고 id를 통해 삭제하는 기능 구현 (진행중) [NDD-111]: Question API에서 질문을 등록하고, 삭제하는 기능 구현(2/2) Nov 12, 2023
@JangAJang JangAJang self-assigned this Nov 12, 2023
@@ -15,12 +15,11 @@ module.exports = {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['/eslintrc.js'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기 부분 설정 변경한거 혹시 문제 발생하셨나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아뇨 추가적인 에러는 없었습니다!

Copy link
Collaborator

@quiet-honey quiet-honey left a comment

Choose a reason for hiding this comment

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

다른 부분 너무 깔끔하게 잘 작성해주셨습니다! PR도 잘 읽었습니다. 주말에 고생하셨습니다!!

@JangAJang JangAJang merged commit 66d6cd6 into dev Nov 13, 2023
1 check passed
@JangAJang JangAJang deleted the feature/NDD-111 branch November 14, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 코드 변경사항 feature 새로운 기능이 추가 된 경우
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants