-
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
[Feature] 모집 완료 API 추가하기 #142
Conversation
- 작성자가 아니면 NotAuthorException 반환 - 모집중인 게시글이 아니면 NotProgressGroupException 반환 - 모집 게시글이 존재하지 않으면 GroupArticleNotFoundException 반환
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.
질문 답변부탁드립니다!!
if (this.userId !== user.id) { | ||
if (!this.isAuthor(user)) { | ||
throw new NotAuthorException(); | ||
} |
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.
비교 구문을 따로 뺀 이유가 있나요? isAuthor 함수를 재사용하는 부분이 있을까요?
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.
@pythonstrup 모집취소나 모집 수정등 자주 사용될 로직으로 생각해 분리했습니다. 그리고 단순히 userId를 비교하는 것만 봤을 때, 행위가 어떤 행위인지 코드 이해도가 없는 사람을 알 수 없기 때문에 이름을 작성자인지 확인하는 과정임을 나타낼 수 있다고 생각했어요.
const categories = await this.groupCategoryRepository.find({ | ||
where: { deletedAt: null }, | ||
}); |
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.
controller에서 service를 통하지 않고 바로 repository를 호출한 이유가 있을까요??
약간 생소하네요..?!?
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.
@pythonstrup 로직없이 단순히 조회해서 바로 응답해주는 부분이라 굳이 서비스를 거치지 않아도 될 것이라고 생각했어요.
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.
수고하셨습니다
체크 리스트
작업 내역
POST /v1/group-articles/:id/recruitment-complete 모집완료 API 제작
NotProgressGroupException
을 반환한다.NotAuthorException
을 반환한다.GroupArticleNotFoundException
을 반환한다.문제 상황과 해결
비고