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

[Feature] 모집 완료 API 추가하기 #142

Merged
merged 5 commits into from
Nov 30, 2022

Conversation

username1103
Copy link
Member

@username1103 username1103 commented Nov 29, 2022

체크 리스트

  • 적절한 제목으로 수정했나요?
  • 관련된 이슈와 연결 시켰나요?
  • Target Branch를 올바르게 설정했나요?
  • Label을 알맞게 설정했나요?

작업 내역

POST /v1/group-articles/:id/recruitment-complete 모집완료 API 제작

  • 모집 게시글을 모집완료 처리한다.
  • 모집진행중이 아닌 게시글을 완료처리하는 경우 NotProgressGroupException을 반환한다.
  • 작성자가 아닌 경우 NotAuthorException을 반환한다.
  • 모집게시글이 존재하지 않는 경우 GroupArticleNotFoundException을 반환한다.

문제 상황과 해결

  • 작업 중 마주한 문제상황 및 해결방법을 남겨주세요.

비고

  • 참고했던 링크 등 참고 사항을 적어주세요. 코드 리뷰하는 사람이 참고해야 하는 내용을 자유로운 형식으로 적을 수 있습니다.

- 작성자가 아니면 NotAuthorException 반환
- 모집중인 게시글이 아니면 NotProgressGroupException 반환
- 모집 게시글이 존재하지 않으면 GroupArticleNotFoundException 반환
@username1103 username1103 self-assigned this Nov 29, 2022
@username1103 username1103 linked an issue Nov 29, 2022 that may be closed by this pull request
2 tasks
@username1103 username1103 requested review from sxungchxn, pythonstrup and kong430 and removed request for sxungchxn November 29, 2022 14:00
Copy link
Collaborator

@kong430 kong430 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

Copy link
Member

@pythonstrup pythonstrup 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 -57 to 60
if (this.userId !== user.id) {
if (!this.isAuthor(user)) {
throw new NotAuthorException();
}
Copy link
Member

Choose a reason for hiding this comment

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

비교 구문을 따로 뺀 이유가 있나요? isAuthor 함수를 재사용하는 부분이 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

@pythonstrup 모집취소나 모집 수정등 자주 사용될 로직으로 생각해 분리했습니다. 그리고 단순히 userId를 비교하는 것만 봤을 때, 행위가 어떤 행위인지 코드 이해도가 없는 사람을 알 수 없기 때문에 이름을 작성자인지 확인하는 과정임을 나타낼 수 있다고 생각했어요.

Comment on lines +80 to +82
const categories = await this.groupCategoryRepository.find({
where: { deletedAt: null },
});
Copy link
Member

Choose a reason for hiding this comment

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

controller에서 service를 통하지 않고 바로 repository를 호출한 이유가 있을까요??
약간 생소하네요..?!?

Copy link
Member Author

Choose a reason for hiding this comment

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

@pythonstrup 로직없이 단순히 조회해서 바로 응답해주는 부분이라 굳이 서비스를 거치지 않아도 될 것이라고 생각했어요.

Copy link
Member

@pythonstrup pythonstrup left a comment

Choose a reason for hiding this comment

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

답변 감사합니다! 고생하셨어요!!

Copy link
Member

@sxungchxn sxungchxn left a comment

Choose a reason for hiding this comment

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

수고하셨습니다

@username1103 username1103 merged commit 364db17 into develop Nov 30, 2022
@username1103 username1103 deleted the feature/116-recuriment-complete branch November 30, 2022 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] 모집 완료 API 추가하기
4 participants