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

[Feat] 프로젝트 관련 API 구현 #63

Merged
merged 11 commits into from
Nov 12, 2024
Merged

[Feat] 프로젝트 관련 API 구현 #63

merged 11 commits into from
Nov 12, 2024

Conversation

jjeonghak
Copy link
Collaborator

@jjeonghak jjeonghak commented Nov 12, 2024

관련 이슈 번호

#54 #56 #64

작업 내용

  • 프로젝트 생성 기능 구현
  • 프로젝트 목록 조회 기능 구현
  • 프로젝트 멤버 초대 기능 구현
  • 프로젝트 멤버 조회 기능 구현
  • 프로젝트 초대 승인/거절 기능 구현
  • 프로젝트 초대 목록 조회 기능 구현

고민과 학습내용

어제 pr에서의 피드백 적용 및 새로운 기능을 추가했습니다.

@jjeonghak jjeonghak added Feature 새로운 기능을 추가 BE 서버 작업 labels Nov 12, 2024
@jjeonghak jjeonghak self-assigned this Nov 12, 2024
@jjeonghak jjeonghak changed the title [Feat] 프로젝트 생성, 조회, 초대 API 구현 [Feat] 프로젝트 관련 API 구현 Nov 12, 2024
@@ -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],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Contributor가 팀원인가용

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

@PMtHk PMtHk left a comment

Choose a reason for hiding this comment

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

👍🏻
대부분 어제 닫으신 PR가 동일하군요!

Comment on lines +142 to +148
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');
}
Copy link
Collaborator

@yangchef1 yangchef1 Nov 12, 2024

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 방식이 가독성이 좋다고 생각합니다 !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

엇 그러네요 이 부분은 수정해두겠습니다

Comment on lines +53 to +58
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');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟢
이 코드는 유사한 형태가 3번 정도 반복되는 것 같네요 !
별도 함수로 분리하셔도 좋을 것 같아요.

@jjeonghak jjeonghak merged commit 737ace1 into dev Nov 12, 2024
2 checks passed
@yangchef1 yangchef1 deleted the feat/#54 branch December 3, 2024 14:32
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.

4 participants