-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat] 프로젝트 관련 API 구현 #63
Conversation
@@ -17,7 +19,7 @@ export class TypeormConfig implements TypeOrmOptionsFactory { | |||
username: this.configService.get<string>('DATABASE_USER'), | |||
password: this.configService.get<string>('DATABASE_PASSWORD'), | |||
database: this.configService.get<string>('DATABASE_NAME'), | |||
entities: [Task, Section, Account], | |||
entities: [Task, Section, Account, Project, Contributor], |
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.
Contributor가 팀원인가용
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.
👍🏻
대부분 어제 닫으신 PR가 동일하군요!
if (!contributor) { | ||
throw new NotFoundException('Does not found invitation'); | ||
} else if (contributor.userId !== userId) { | ||
throw new ForbiddenException('Permission denied'); | ||
} else if (contributor.status !== ContributorStatus.PENDING) { | ||
throw new BadRequestException('Already update invitation'); | ||
} |
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.
🟢
service 코드에서 else if
와 Early Return 방식이 모두 보이는데, 통일성있게 작성하는게 좋아보여요 !
개인적으로 else if
를 여러번 사용하는 것보단 Early Return 방식이 가독성이 좋다고 생각합니다 !
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 userContributor = await this.contributorRepository.findOneBy({ userId, projectId }); | ||
if (!userContributor) { | ||
throw new NotFoundException('Does not found user contributor or project'); | ||
} else if (userContributor.status !== ContributorStatus.ACCEPTED) { | ||
throw new ForbiddenException('Permission denied'); | ||
} |
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.
🟢
이 코드는 유사한 형태가 3번 정도 반복되는 것 같네요 !
별도 함수로 분리하셔도 좋을 것 같아요.
관련 이슈 번호
#54 #56 #64
작업 내용
고민과 학습내용
어제 pr에서의 피드백 적용 및 새로운 기능을 추가했습니다.