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 #168

Merged
merged 9 commits into from
Dec 1, 2022

Conversation

pythonstrup
Copy link
Member

체크 리스트

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

작업 내역

  • 모임 신청자 조회하기 API
  • 예외처리 및 DTO 작성

Comment on lines +117 to +129
private async getApplicationWithUserInfo(group: Group) {
const allApplication =
await this.groupApplicationRepository.findAllApplicationByGroup(group.id);

const applicationWithUserInfoList = allApplication.map(
async (application) => {
const user = await application.user;
return ApplicationWithUserInfoResponse.from(
UserInfo.from(user),
application,
);
},
);
Copy link
Member

Choose a reason for hiding this comment

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

위와 같은 상태에서는 N+1 Problem이 발생할 것 같습니다.

현재 순서가 해당 모집게시글의 모집 신청 정보들을 가져오고 각각 정보들에 맞는 유저 데이터를 가져오는데 이렇게되면 신청한 유저수가 N명이면 N+1개의 쿼리가 발생하게 될 것 같아요.

처음에 조회해 올 때 부터 함께 조회해오도록 수정하면 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

학습하고 반영했습니다!
감사합니다!!!!

Copy link
Member

@username1103 username1103 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.

수고하셨어요!

@pythonstrup pythonstrup merged commit 5a1b9a0 into develop Dec 1, 2022
@pythonstrup pythonstrup deleted the feature/149-get-all-participants-api branch December 13, 2022 03:18
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
3 participants